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