[JS IR IC] Interface default implementations affect IC hash
Adding or removing a method or property with a default implementation to an interface should invalidate all children: we must regenerate JS code for them ^KT-56237 Fixed
This commit is contained in:
committed by
Space Team
parent
bad5c58952
commit
81b591ed21
js/js.translator/testData/incremental/invalidation/localObjectsLeakThroughInterface/lib1/classA.0.kt
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
class ClassA {
|
||||
fun leakObject(): Interface {
|
||||
val obj = object : Interface {}
|
||||
return obj
|
||||
}
|
||||
}
|
||||
js/js.translator/testData/incremental/invalidation/localObjectsLeakThroughInterface/lib1/classA.1.kt
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
class ClassA {
|
||||
fun leakObject(): Interface {
|
||||
val obj = object : Interface {
|
||||
override fun getNumber() = 1
|
||||
}
|
||||
return obj
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
interface Interface {
|
||||
val extraNumber get() = 0
|
||||
|
||||
fun getNumber() = 0
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
interface Interface {
|
||||
val extraNumber get() = 1
|
||||
|
||||
fun getNumber() = 0
|
||||
|
||||
fun getOtherNumber() = 1
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
interface Interface {
|
||||
val extraNumber get() = 2
|
||||
|
||||
fun getNumber() = 0
|
||||
|
||||
fun getOtherNumber() = 1
|
||||
|
||||
val otherExtraNumber get() = 1
|
||||
}
|
||||
js/js.translator/testData/incremental/invalidation/localObjectsLeakThroughInterface/lib1/module.info
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
STEP 0:
|
||||
modifications:
|
||||
U : classA.0.kt -> classA.kt
|
||||
U : interface.0.kt -> interface.kt
|
||||
added file: classA.kt, interface.kt
|
||||
STEP 1:
|
||||
modifications:
|
||||
U : classA.1.kt -> classA.kt
|
||||
modified ir: classA.kt
|
||||
STEP 2:
|
||||
modifications:
|
||||
U : interface.2.kt -> interface.kt
|
||||
modified ir: interface.kt
|
||||
updated exports: interface.kt
|
||||
updated imports: classA.kt
|
||||
STEP 3:
|
||||
STEP 4:
|
||||
modifications:
|
||||
U : interface.4.kt -> interface.kt
|
||||
modified ir: interface.kt
|
||||
updated exports: interface.kt
|
||||
updated imports: classA.kt
|
||||
STEP 5:
|
||||
updated exports: interface.kt
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
fun box(stepId: Int): String {
|
||||
val x = test()
|
||||
if (x != stepId) {
|
||||
return "Fail $x != $stepId"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
js/js.translator/testData/incremental/invalidation/localObjectsLeakThroughInterface/main/module.info
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
STEP 0:
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : test.0.kt -> test.kt
|
||||
added file: m.kt, test.kt
|
||||
STEP 1:
|
||||
dependencies: lib1
|
||||
STEP 2:
|
||||
dependencies: lib1
|
||||
updated imports: test.kt
|
||||
STEP 3:
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : test.3.kt -> test.kt
|
||||
modified ir: test.kt
|
||||
STEP 4:
|
||||
dependencies: lib1
|
||||
updated imports: test.kt
|
||||
STEP 5:
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : test.5.kt -> test.kt
|
||||
modified ir: test.kt
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
fun test(): Int {
|
||||
val a = ClassA()
|
||||
val obj = a.leakObject()
|
||||
return obj.getNumber() + obj.extraNumber
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
fun test(): Int {
|
||||
val a = ClassA()
|
||||
val obj = a.leakObject()
|
||||
return obj.getNumber() + obj.extraNumber + obj.getOtherNumber()
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
fun test(): Int {
|
||||
val a = ClassA()
|
||||
val obj = a.leakObject()
|
||||
return obj.getNumber() + obj.extraNumber + obj.getOtherNumber() + obj.otherExtraNumber
|
||||
}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
MODULES: lib1, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, main
|
||||
dirty js: lib1, main
|
||||
STEP 1:
|
||||
libs: lib1, main
|
||||
dirty js: lib1
|
||||
STEP 2:
|
||||
libs: lib1, main
|
||||
dirty js: lib1, main
|
||||
STEP 3:
|
||||
libs: lib1, main
|
||||
dirty js: main
|
||||
STEP 4..5:
|
||||
libs: lib1, main
|
||||
dirty js: lib1, main
|
||||
Reference in New Issue
Block a user