[JS IR] Add work around in EnumEntriesList for JS IR to avoid name clashes
JS IR generates bridges with type checks for special class methods, however if parent and child type parameters are same, the JS signature for the generated brige will be clashed with the JS signature of original method. This patch changes type parameter name of EnumEntriesList to avoid the clash. ^KT-54011 Fixed
This commit is contained in:
committed by
Space
parent
639af77b91
commit
47bbd5e8c1
@@ -0,0 +1,8 @@
|
||||
@kotlin.ExperimentalStdlibApi
|
||||
fun box(stepId: Int): String {
|
||||
when {
|
||||
!testEnumValues(stepId) -> return "Fail testEnumValues"
|
||||
!testEnumEntries(stepId) -> return "Fail testEnumEntries"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
STEP 0:
|
||||
modifications:
|
||||
U : testEnumEntries.0.kt -> testEnumEntries.kt
|
||||
dependencies: lib1
|
||||
added file: m.kt, testEnumEntries.kt, testEnumValues.kt
|
||||
STEP 1:
|
||||
dependencies: lib1
|
||||
STEP 2:
|
||||
dependencies: lib1
|
||||
modified config: m.kt, testEnumEntries.kt, testEnumValues.kt
|
||||
STEP 3:
|
||||
modifications:
|
||||
U : testEnumEntries.3.kt -> testEnumEntries.kt
|
||||
dependencies: lib1
|
||||
modified ir: testEnumEntries.kt
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
@kotlin.ExperimentalStdlibApi
|
||||
fun testEnumEntries(stepId: Int): Boolean {
|
||||
return true
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
@kotlin.ExperimentalStdlibApi
|
||||
fun testEnumEntries(stepId: Int): Boolean {
|
||||
val entries = TestEnum.entries
|
||||
|
||||
if (entries.contains((object {}) as Any?)) return false
|
||||
|
||||
when (stepId) {
|
||||
0 -> if (entries.isNotEmpty()) return false
|
||||
1, 2, 3 -> {
|
||||
if (entries.size != 2) return false
|
||||
if (entries.indexOf(TestEnum.A) != 0) return false
|
||||
if (entries.indexOf(TestEnum.B) != 1) return false
|
||||
}
|
||||
else -> return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fun testEnumValues(stepId: Int): Boolean {
|
||||
val values = enumValues<TestEnum>().map { it.ordinal to it.name }
|
||||
when (stepId) {
|
||||
0 -> if (values.isEmpty()) return true
|
||||
1, 2, 3 -> if (values == listOf(0 to "A", 1 to "B")) return true
|
||||
else -> return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user