Fix reified parameters with non-identifier names in JS
See KT-18169
This commit is contained in:
@@ -189,7 +189,7 @@ public final class Namer {
|
||||
|
||||
@NotNull
|
||||
public static String isInstanceSuggestedName(@NotNull TypeParameterDescriptor descriptor) {
|
||||
return "is" + descriptor.getName().getIdentifier();
|
||||
return "is" + NameSuggestion.sanitizeName(descriptor.getName().getIdentifier());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -28,10 +28,20 @@ fun test4(): String {
|
||||
return `[£]`()
|
||||
}
|
||||
|
||||
inline fun <reified `-`> test5(): String = `-`::class.simpleName!!
|
||||
|
||||
inline fun <reified `-`> test6(x: Any): Boolean = x is `-`
|
||||
|
||||
class OK
|
||||
|
||||
fun box(): String {
|
||||
if (test1() != 20) return "fail1"
|
||||
if (test2(10, 13) != 23) return "fail2"
|
||||
if (test3() != "OK") return "fail3"
|
||||
if (test4() != "OK") return "fail4"
|
||||
|
||||
if (test5<OK>() != "OK") return "fail5"
|
||||
if (!test6<String>("foo")) return "fail6"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user