Process '$' correctly in "Convert concatenation to template"

So #KT-12226 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-03-14 12:46:10 +03:00
committed by Mikhail Glukhikh
parent 3b2bbee595
commit 66906e2c80
4 changed files with 14 additions and 1 deletions
@@ -86,9 +86,10 @@ open class ConvertToStringTemplateIntention : SelfTargetingOffsetIndependentInte
if (KotlinBuiltIns.isChar(type)) {
val value = expressionText.removePrefix("'").removeSuffix("'")
return when (value) { // escape double quote and unescape single one
return when (value) { // escape double quote and unescape single one and $
"\"" -> "\\\""
"\\'" -> "'"
"$" -> if (forceBraces) "\\$" else "$"
else -> value
}
}