[JS IR] Add IC test for interface with default implementation
This commit is contained in:
committed by
Space Team
parent
180613e1c6
commit
9da9c95105
Generated
+6
@@ -271,6 +271,12 @@ public class JsFirInvalidationTestGenerated extends AbstractJsFirInvalidationTes
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionWithObject/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceOpenMethods")
|
||||
public void testInterfaceOpenMethods() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceOpenMethods/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceSuperUsage")
|
||||
public void testInterfaceSuperUsage() throws Exception {
|
||||
|
||||
Generated
+6
@@ -271,6 +271,12 @@ public class JsIrES6InvalidationTestGenerated extends AbstractJsIrES6Invalidatio
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionWithObject/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceOpenMethods")
|
||||
public void testInterfaceOpenMethods() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceOpenMethods/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceSuperUsage")
|
||||
public void testInterfaceSuperUsage() throws Exception {
|
||||
|
||||
+6
@@ -271,6 +271,12 @@ public class JsIrInvalidationTestGenerated extends AbstractJsIrInvalidationTest
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionWithObject/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceOpenMethods")
|
||||
public void testInterfaceOpenMethods() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceOpenMethods/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceSuperUsage")
|
||||
public void testInterfaceSuperUsage() throws Exception {
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
interface A {
|
||||
fun testA1() = 1
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
interface A {
|
||||
fun testA1() = 2
|
||||
|
||||
fun testA2() = 1
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
interface B : A {
|
||||
fun testB1() = 2
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
interface C : B {
|
||||
fun testC1() = 3
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
STEP 0:
|
||||
modifications:
|
||||
U : InterfaceA.0.kt -> InterfaceA.kt
|
||||
U : InterfaceB.0.kt -> InterfaceB.kt
|
||||
U : InterfaceC.0.kt -> InterfaceC.kt
|
||||
added file: InterfaceA.kt, InterfaceB.kt, InterfaceC.kt
|
||||
STEP 1:
|
||||
modifications:
|
||||
U : InterfaceA.1.kt -> InterfaceA.kt
|
||||
modified ir: InterfaceA.kt
|
||||
updated exports: InterfaceA.kt
|
||||
updated imports: InterfaceB.kt, InterfaceC.kt
|
||||
STEP 2:
|
||||
updated exports: InterfaceB.kt, InterfaceC.kt
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun getObjectA() : A {
|
||||
return myObject
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun getObjectB() : B {
|
||||
return myObject
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun getObjectC() : C {
|
||||
return myObject
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
private class MyClass : C {
|
||||
}
|
||||
|
||||
internal val myObject: C = MyClass()
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
STEP 0:
|
||||
dependencies: lib1
|
||||
added file: GetA.kt, GetB.kt, GetC.kt, MyClass.kt
|
||||
STEP 1:
|
||||
dependencies: lib1
|
||||
updated imports: MyClass.kt, GetB.kt, GetC.kt, GetA.kt
|
||||
STEP 2:
|
||||
dependencies: lib1
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
fun box(stepId: Int): String {
|
||||
val expected = when (stepId) {
|
||||
0 -> 10
|
||||
1 -> 13
|
||||
2 -> 16
|
||||
else -> return "Unknown"
|
||||
}
|
||||
|
||||
val x = test()
|
||||
if (expected != x) {
|
||||
return "Fail $expected != $x"
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
STEP 0:
|
||||
dependencies: lib1, lib2
|
||||
modifications:
|
||||
U : test.0.kt -> test.kt
|
||||
added file: m.kt, test.kt
|
||||
STEP 1:
|
||||
dependencies: lib1, lib2
|
||||
updated imports: test.kt
|
||||
STEP 2:
|
||||
dependencies: lib1, lib2
|
||||
modifications:
|
||||
U : test.2.kt -> test.kt
|
||||
modified ir: test.kt
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun test(): Int {
|
||||
val a = getObjectA()
|
||||
val b = getObjectB()
|
||||
val c = getObjectC()
|
||||
|
||||
return a.testA1() + b.testA1() + b.testB1() + c.testA1() + c.testB1() + c.testC1()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fun test(): Int {
|
||||
val a = getObjectA()
|
||||
val b = getObjectB()
|
||||
val c = getObjectC()
|
||||
|
||||
return a.testA1() + a.testA2() +
|
||||
b.testA1() + b.testA2() + b.testB1() +
|
||||
c.testA1() + c.testA2() + c.testB1() + c.testC1()
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0..1:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: lib1, lib2, main
|
||||
STEP 2:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: lib1, main
|
||||
Reference in New Issue
Block a user