From 09c9a60b30aaaaffba824b1488536de3568108e6 Mon Sep 17 00:00:00 2001 From: Kevin Galligan Date: Fri, 13 Apr 2018 11:29:07 -0400 Subject: [PATCH] Objective-C names with '$' in them where blowing up (#1497) Now they do not. May be other problematic characters. --- .../kotlin/org/jetbrains/kotlin/native/interop/gen/CodeUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/CodeUtils.kt b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/CodeUtils.kt index 9517a26a6e2..dd00c5a4342 100644 --- a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/CodeUtils.kt +++ b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/CodeUtils.kt @@ -38,7 +38,7 @@ typealias KotlinExpression = String * For this identifier constructs the string to be parsed by Kotlin as `SimpleName` * defined [here](https://kotlinlang.org/docs/reference/grammar.html#SimpleName). */ -fun String.asSimpleName(): String = if (this in kotlinKeywords) { +fun String.asSimpleName(): String = if (this in kotlinKeywords || this.contains("$")) { "`$this`" } else { this