kotlin
kotlin copied to clipboard
[FIR] Don't unescape twice when processing ESCAPE_STRING_TEMPLATE_ENTRY
This change avoids needlessly unescaping a character escape sequence in a string twice.
In the psi2fir case, different unescaping implementations were used for the path with template expressions and the path without any template expressions ("fast-pass"); ConversionUtils.escapedStringToCharacter vs. StringUtil.unescapeStringCharacters. The latter supports all of Java's escape sequences instead of just the ones supported by Kotlin. This was not a problem in practice, because when ConversionUtils.escapedStringToCharacter returned an error, the potentially wrongly unescaped value in sb was not used. So this PR does not change the output of AbstractRawFirBuilder.toInterpolatingCall.