Fix reified parameters with non-identifier names in JS

See KT-18169
This commit is contained in:
Alexey Andreev
2017-06-13 16:29:48 +03:00
parent d3a5201ecc
commit 3ae214b97a
2 changed files with 11 additions and 1 deletions
@@ -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"
}