[JS IR] Add a test with an object in inline function for JS IC

This commit is contained in:
Alexander Korepanov
2022-09-09 11:57:05 +02:00
committed by Space
parent 7a8250cf17
commit ea7ce55082
9 changed files with 55 additions and 0 deletions
@@ -165,6 +165,11 @@ public class InvalidationTestGenerated extends AbstractInvalidationTest {
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionDefaultParams/");
}
@TestMetadata("inlineFunctionWithObject")
public void testInlineFunctionWithObject() throws Exception {
runTest("js/js.translator/testData/incremental/invalidation/inlineFunctionWithObject/");
}
@TestMetadata("jsCode")
public void testJsCode() throws Exception {
runTest("js/js.translator/testData/incremental/invalidation/jsCode/");
@@ -0,0 +1,3 @@
interface DemoInterface {
fun doAnything(): Int
}
@@ -0,0 +1,3 @@
STEP 0:
added file: l1.kt
STEP 1:
@@ -0,0 +1,7 @@
inline fun foo(): DemoInterface {
return object : DemoInterface {
override fun doAnything(): Int {
return 0
}
}
}
@@ -0,0 +1,7 @@
inline fun foo(): DemoInterface {
return object : DemoInterface {
override fun doAnything(): Int {
return 1
}
}
}
@@ -0,0 +1,10 @@
STEP 0:
dependencies: lib1
modifications:
U : l2.0.kt -> l2.kt
added file: l2.kt
STEP 1:
dependencies: lib1
modifications:
U : l2.1.kt -> l2.kt
modified ir: l2.kt
@@ -0,0 +1,6 @@
fun box(stepId: Int): String {
if (foo().doAnything() != stepId) {
return "Fail"
}
return "OK"
}
@@ -0,0 +1,6 @@
STEP 0:
dependencies: lib1, lib2
added file: m.kt
STEP 1:
dependencies: lib1, lib2
updated imports: m.kt
@@ -0,0 +1,8 @@
MODULES: lib1, lib2, main
STEP 0:
libs: lib1, lib2, main
dirty js: lib1, lib2, main
STEP 1:
libs: lib1, lib2, main
dirty js: lib2, main