[K/JS] Rework symbol hash calculation to make IC works with @JsExport and @JsName changes
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
interface Foo {
|
||||
fun foo(): String
|
||||
fun default(): String = "Default"
|
||||
}
|
||||
|
||||
open class Bar {
|
||||
open fun bar(): String = "Bar"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
interface Foo {
|
||||
@JsName("_foo_")
|
||||
fun foo(): String
|
||||
fun default(): String = "Default"
|
||||
}
|
||||
|
||||
open class Bar {
|
||||
open fun bar(): String = "Bar"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
interface Foo {
|
||||
@JsName("_foo_")
|
||||
fun foo(): String
|
||||
@JsName("_default_")
|
||||
fun default(): String = "Default"
|
||||
}
|
||||
|
||||
open class Bar {
|
||||
open fun bar(): String = "Bar"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
interface Foo {
|
||||
@JsName("_foo_")
|
||||
fun foo(): String
|
||||
@JsName("_default_")
|
||||
fun default(): String = "Default"
|
||||
}
|
||||
|
||||
open class Bar {
|
||||
@JsName("_bar_")
|
||||
open fun bar(): String = "Bar"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
STEP 0:
|
||||
modifications:
|
||||
U : lib.0.kt -> lib.kt
|
||||
added file: lib.kt
|
||||
STEP 1:
|
||||
STEP 2:
|
||||
modifications:
|
||||
U : lib.2.kt -> lib.kt
|
||||
modified ir: lib.kt
|
||||
STEP 3:
|
||||
modifications:
|
||||
U : lib.3.kt -> lib.kt
|
||||
modified ir: lib.kt
|
||||
STEP 4:
|
||||
modifications:
|
||||
U : lib.4.kt -> lib.kt
|
||||
modified ir: lib.kt
|
||||
STEP 5:
|
||||
@@ -0,0 +1,3 @@
|
||||
open class FooBarImpl : Bar(), Foo {
|
||||
override fun foo() = "FooImpl"
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
STEP 0:
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : lib.0.kt -> lib.kt
|
||||
added file: lib.kt
|
||||
STEP 1:
|
||||
dependencies: lib1
|
||||
updated exports: lib.kt
|
||||
STEP 2:
|
||||
dependencies: lib1
|
||||
updated imports: lib.kt
|
||||
STEP 3:
|
||||
dependencies: lib1
|
||||
updated imports: lib.kt
|
||||
STEP 4:
|
||||
dependencies: lib1
|
||||
updated imports: lib.kt
|
||||
STEP 5:
|
||||
dependencies: lib1
|
||||
updated exports: lib.kt
|
||||
@@ -0,0 +1 @@
|
||||
class TestClass : FooBarImpl()
|
||||
@@ -0,0 +1,3 @@
|
||||
class TestClass : FooBarImpl() {
|
||||
override fun default(): String = "TestClass"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
class TestClass : FooBarImpl()
|
||||
@@ -0,0 +1,24 @@
|
||||
STEP 0:
|
||||
dependencies: lib1, lib2
|
||||
modifications:
|
||||
U : lib.0.kt -> lib.kt
|
||||
added file: lib.kt
|
||||
STEP 1:
|
||||
dependencies: lib1, lib2
|
||||
modifications:
|
||||
U : lib.1.kt -> lib.kt
|
||||
modified ir: lib.kt
|
||||
STEP 2:
|
||||
dependencies: lib1, lib2
|
||||
updated imports: lib.kt
|
||||
STEP 3:
|
||||
dependencies: lib1, lib2
|
||||
updated imports: lib.kt
|
||||
STEP 4:
|
||||
dependencies: lib1, lib2
|
||||
updated imports: lib.kt
|
||||
STEP 5:
|
||||
dependencies: lib1, lib2
|
||||
modifications:
|
||||
U : lib.5.kt -> lib.kt
|
||||
modified ir: lib.kt
|
||||
@@ -0,0 +1,34 @@
|
||||
fun box(step: Int): String {
|
||||
val x = TestClass()
|
||||
|
||||
if (x.bar() != "Bar") return "Fail bar in Bar"
|
||||
if (x.foo() != "FooImpl") return "Fail overridden foo in FooBarImpl"
|
||||
|
||||
when (step) {
|
||||
0 -> {
|
||||
if (x.default() != "Default") return "Fail default in Foo"
|
||||
}
|
||||
1 -> {
|
||||
if (x.default() != "TestClass") return "Fail default in TestClass"
|
||||
}
|
||||
2 -> {
|
||||
if (x.asDynamic()._foo_() != "FooImpl") return "Fail overridden foo in FooBarImpl with @JsName"
|
||||
}
|
||||
3 -> {
|
||||
if (x.asDynamic()._foo_() != "FooImpl") return "Fail overridden foo in FooBarImpl with @JsName"
|
||||
if (x.asDynamic()._default_() != "TestClass") return "Fail default in TestClass with @JsName"
|
||||
}
|
||||
4 -> {
|
||||
if (x.asDynamic()._foo_() != "FooImpl") return "Fail overridden foo in FooBarImpl with @JsName"
|
||||
if (x.asDynamic()._default_() != "TestClass") return "Fail default in TestClass with @JsName"
|
||||
if (x.asDynamic()._bar_() != "Bar") return "Fail bar in Bar with @JsName"
|
||||
}
|
||||
5 -> {
|
||||
if (x.asDynamic()._foo_() != "FooImpl") return "Fail overridden foo in FooBarImpl with @JsName"
|
||||
if (x.asDynamic()._default_() != "Default") return "Fail default in Default with @JsName"
|
||||
if (x.asDynamic()._bar_() != "Bar") return "Fail bar in Bar with @JsName"
|
||||
}
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
STEP 0:
|
||||
dependencies: lib1, lib2, lib3
|
||||
added file: m.kt
|
||||
STEP 1:
|
||||
dependencies: lib1, lib2, lib3
|
||||
updated imports: m.kt
|
||||
STEP 2:
|
||||
dependencies: lib1, lib2, lib3
|
||||
updated imports: m.kt
|
||||
STEP 3:
|
||||
dependencies: lib1, lib2, lib3
|
||||
updated imports: m.kt
|
||||
STEP 4:
|
||||
dependencies: lib1, lib2, lib3
|
||||
updated imports: m.kt
|
||||
STEP 5:
|
||||
dependencies: lib1, lib2, lib3
|
||||
updated imports: m.kt
|
||||
@@ -0,0 +1,26 @@
|
||||
MODULES: lib1, lib2, lib3, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, lib3, main
|
||||
dirty js modules: lib1, lib2, lib3, main
|
||||
dirty js files: lib1/lib, lib2/lib, lib3/lib, main/m, main/m.export, main
|
||||
STEP 1:
|
||||
libs: lib1, lib2, lib3, main
|
||||
dirty js modules: lib2, lib3, main
|
||||
dirty js files: lib2/lib, lib3/lib, main/m
|
||||
STEP 2:
|
||||
libs: lib1, lib2, lib3, main
|
||||
dirty js modules: lib1, lib2, lib3, main
|
||||
dirty js files: lib1/lib, lib2/lib, lib3/lib, main/m
|
||||
STEP 3:
|
||||
libs: lib1, lib2, lib3, main
|
||||
dirty js modules: lib1, lib2, lib3, main
|
||||
dirty js files: lib1/lib, lib2/lib, lib3/lib, main/m
|
||||
STEP 4:
|
||||
libs: lib1, lib2, lib3, main
|
||||
dirty js modules: lib1, lib2, lib3, main
|
||||
dirty js files: lib1/lib, lib2/lib, lib3/lib, main/m
|
||||
STEP 5:
|
||||
libs: lib1, lib2, lib3, main
|
||||
dirty js modules: lib2, lib3, main
|
||||
dirty js files: lib2/lib, lib3/lib, main/m
|
||||
Reference in New Issue
Block a user