[K/JS] Rework symbol hash calculation to make IC works with @JsExport and @JsName changes
This commit is contained in:
+28
-17
@@ -22,7 +22,7 @@ internal class IdSignatureHashCalculator(private val icHasher: ICHasher) {
|
||||
private val idSignatureSources = hashMapOf<IdSignature, IdSignatureSource>()
|
||||
private val idSignatureHashes = hashMapOf<IdSignature, ICHash>()
|
||||
|
||||
private val fileAnnotationHashes = hashMapOf<IrFile, ICHash>()
|
||||
private val annotationContainerHashes = hashMapOf<IrSymbolOwner, ICHash>()
|
||||
private val constantHashes = hashMapOf<IrProperty, ICHash>()
|
||||
private val inlineFunctionFlatHashes = hashMapOf<IrFunction, ICHash>()
|
||||
|
||||
@@ -33,10 +33,8 @@ internal class IdSignatureHashCalculator(private val icHasher: ICHasher) {
|
||||
|
||||
private val inlineFunctionDepends = hashMapOf<IrFunction, InlineFunctionDependencies>()
|
||||
|
||||
private val IrFile.annotationsHash: ICHash
|
||||
get() = fileAnnotationHashes.getOrPut(this) {
|
||||
icHasher.calculateIrAnnotationContainerHash(this)
|
||||
}
|
||||
private val IrSymbolOwner.annotationsHash: ICHash
|
||||
get() = annotationContainerHashes.getOrPut(this) { calculateAnnotationHash() }
|
||||
|
||||
private val IrProperty.constantHash: ICHash
|
||||
get() = constantHashes.getOrPut(this) {
|
||||
@@ -87,18 +85,31 @@ internal class IdSignatureHashCalculator(private val icHasher: ICHasher) {
|
||||
InlineFunctionDependencies(usedInlineFunctions, usedConstants)
|
||||
}
|
||||
|
||||
private fun IrSymbol.calculateSymbolHash(): ICHash {
|
||||
var srcIrFile = signature?.let { sig -> idSignatureSources[sig]?.irFile }
|
||||
if (srcIrFile == null) {
|
||||
var parentDeclaration = (owner as? IrDeclaration)?.parent
|
||||
while (parentDeclaration is IrDeclaration) {
|
||||
parentDeclaration = parentDeclaration.parent
|
||||
}
|
||||
srcIrFile = parentDeclaration as? IrFile
|
||||
private operator fun ICHash.plus(other: ICHash) = ICHash(hash.combineWith(other.hash))
|
||||
|
||||
private fun IrSymbolOwner.calculateAnnotationHash(): ICHash {
|
||||
val annotationContainer = this as? IrAnnotationContainer ?: return ICHash()
|
||||
var symbolAnnotationsHash = icHasher.calculateIrAnnotationContainerHash(annotationContainer)
|
||||
|
||||
val declaration = this as? IrDeclaration
|
||||
|
||||
(declaration?.parent as? IrSymbolOwner)?.let { symbolAnnotationsHash += it.annotationsHash }
|
||||
|
||||
if (declaration is IrSimpleFunction) {
|
||||
declaration.correspondingPropertySymbol?.let { symbolAnnotationsHash += it.owner.annotationsHash }
|
||||
}
|
||||
|
||||
val fileAnnotationsHash = srcIrFile?.annotationsHash ?: ICHash()
|
||||
return ICHash(fileAnnotationsHash.hash.combineWith(icHasher.calculateIrSymbolHash(this).hash))
|
||||
if (declaration is IrOverridableDeclaration<*>) {
|
||||
declaration.overriddenSymbols.forEach {
|
||||
symbolAnnotationsHash += it.owner.annotationsHash
|
||||
}
|
||||
}
|
||||
|
||||
return symbolAnnotationsHash
|
||||
}
|
||||
|
||||
private fun IrSymbol.calculateSymbolHash(): ICHash {
|
||||
return owner.annotationsHash + icHasher.calculateIrSymbolHash(this)
|
||||
}
|
||||
|
||||
private fun IrFunction.calculateInlineFunctionTransitiveHash(): ICHash {
|
||||
@@ -111,11 +122,11 @@ internal class IdSignatureHashCalculator(private val icHasher: ICHasher) {
|
||||
for (inlineFunction in usedInlineFunctions) {
|
||||
if (transitiveDepends.add(inlineFunction)) {
|
||||
newDependsStack += inlineFunction
|
||||
transitiveHash = ICHash(transitiveHash.hash.combineWith(inlineFunction.inlineFunctionFlatHash.hash))
|
||||
transitiveHash += inlineFunction.inlineFunctionFlatHash
|
||||
}
|
||||
}
|
||||
for (constant in usedConstants) {
|
||||
transitiveHash = ICHash(transitiveHash.hash.combineWith(constant.constantHash.hash))
|
||||
transitiveHash += constant.constantHash
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Generated
+24
@@ -20,6 +20,12 @@ import java.util.regex.Pattern;
|
||||
@TestMetadata("js/js.translator/testData/incremental/invalidation")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsFirInvalidationPerFileTestGenerated extends AbstractJsFirInvalidationPerFileTest {
|
||||
@Test
|
||||
@TestMetadata("abstractClassWithJsExport")
|
||||
public void testAbstractClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/abstractClassWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("addUpdateRemoveDependentFile")
|
||||
public void testAddUpdateRemoveDependentFile() throws Exception {
|
||||
@@ -61,6 +67,12 @@ public class JsFirInvalidationPerFileTestGenerated extends AbstractJsFirInvalida
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classFunctionsAndFields/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classWithJsExport")
|
||||
public void testClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionConstVal")
|
||||
public void testCompanionConstVal() throws Exception {
|
||||
@@ -301,6 +313,12 @@ public class JsFirInvalidationPerFileTestGenerated extends AbstractJsFirInvalida
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceWithJsExport")
|
||||
public void testInterfaceWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCode")
|
||||
public void testJsCode() throws Exception {
|
||||
@@ -349,6 +367,12 @@ public class JsFirInvalidationPerFileTestGenerated extends AbstractJsFirInvalida
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsModuleAnnotationOnObjectWithUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsName")
|
||||
public void testJsName() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsName/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinTest")
|
||||
public void testKotlinTest() throws Exception {
|
||||
|
||||
Generated
+24
@@ -20,6 +20,12 @@ import java.util.regex.Pattern;
|
||||
@TestMetadata("js/js.translator/testData/incremental/invalidation")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsFirInvalidationPerModuleTestGenerated extends AbstractJsFirInvalidationPerModuleTest {
|
||||
@Test
|
||||
@TestMetadata("abstractClassWithJsExport")
|
||||
public void testAbstractClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/abstractClassWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("addUpdateRemoveDependentFile")
|
||||
public void testAddUpdateRemoveDependentFile() throws Exception {
|
||||
@@ -61,6 +67,12 @@ public class JsFirInvalidationPerModuleTestGenerated extends AbstractJsFirInvali
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classFunctionsAndFields/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classWithJsExport")
|
||||
public void testClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionConstVal")
|
||||
public void testCompanionConstVal() throws Exception {
|
||||
@@ -301,6 +313,12 @@ public class JsFirInvalidationPerModuleTestGenerated extends AbstractJsFirInvali
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceWithJsExport")
|
||||
public void testInterfaceWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCode")
|
||||
public void testJsCode() throws Exception {
|
||||
@@ -349,6 +367,12 @@ public class JsFirInvalidationPerModuleTestGenerated extends AbstractJsFirInvali
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsModuleAnnotationOnObjectWithUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsName")
|
||||
public void testJsName() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsName/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinTest")
|
||||
public void testKotlinTest() throws Exception {
|
||||
|
||||
Generated
+24
@@ -20,6 +20,12 @@ import java.util.regex.Pattern;
|
||||
@TestMetadata("js/js.translator/testData/incremental/invalidation")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsIrES6InvalidationPerFileTestGenerated extends AbstractJsIrES6InvalidationPerFileTest {
|
||||
@Test
|
||||
@TestMetadata("abstractClassWithJsExport")
|
||||
public void testAbstractClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/abstractClassWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("addUpdateRemoveDependentFile")
|
||||
public void testAddUpdateRemoveDependentFile() throws Exception {
|
||||
@@ -61,6 +67,12 @@ public class JsIrES6InvalidationPerFileTestGenerated extends AbstractJsIrES6Inva
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classFunctionsAndFields/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classWithJsExport")
|
||||
public void testClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionConstVal")
|
||||
public void testCompanionConstVal() throws Exception {
|
||||
@@ -301,6 +313,12 @@ public class JsIrES6InvalidationPerFileTestGenerated extends AbstractJsIrES6Inva
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceWithJsExport")
|
||||
public void testInterfaceWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCode")
|
||||
public void testJsCode() throws Exception {
|
||||
@@ -349,6 +367,12 @@ public class JsIrES6InvalidationPerFileTestGenerated extends AbstractJsIrES6Inva
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsModuleAnnotationOnObjectWithUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsName")
|
||||
public void testJsName() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsName/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinTest")
|
||||
public void testKotlinTest() throws Exception {
|
||||
|
||||
+24
@@ -20,6 +20,12 @@ import java.util.regex.Pattern;
|
||||
@TestMetadata("js/js.translator/testData/incremental/invalidation")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsIrES6InvalidationPerModuleTestGenerated extends AbstractJsIrES6InvalidationPerModuleTest {
|
||||
@Test
|
||||
@TestMetadata("abstractClassWithJsExport")
|
||||
public void testAbstractClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/abstractClassWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("addUpdateRemoveDependentFile")
|
||||
public void testAddUpdateRemoveDependentFile() throws Exception {
|
||||
@@ -61,6 +67,12 @@ public class JsIrES6InvalidationPerModuleTestGenerated extends AbstractJsIrES6In
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classFunctionsAndFields/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classWithJsExport")
|
||||
public void testClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionConstVal")
|
||||
public void testCompanionConstVal() throws Exception {
|
||||
@@ -301,6 +313,12 @@ public class JsIrES6InvalidationPerModuleTestGenerated extends AbstractJsIrES6In
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceWithJsExport")
|
||||
public void testInterfaceWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCode")
|
||||
public void testJsCode() throws Exception {
|
||||
@@ -349,6 +367,12 @@ public class JsIrES6InvalidationPerModuleTestGenerated extends AbstractJsIrES6In
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsModuleAnnotationOnObjectWithUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsName")
|
||||
public void testJsName() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsName/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinTest")
|
||||
public void testKotlinTest() throws Exception {
|
||||
|
||||
Generated
+24
@@ -20,6 +20,12 @@ import java.util.regex.Pattern;
|
||||
@TestMetadata("js/js.translator/testData/incremental/invalidation")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsIrInvalidationPerFileTestGenerated extends AbstractJsIrInvalidationPerFileTest {
|
||||
@Test
|
||||
@TestMetadata("abstractClassWithJsExport")
|
||||
public void testAbstractClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/abstractClassWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("addUpdateRemoveDependentFile")
|
||||
public void testAddUpdateRemoveDependentFile() throws Exception {
|
||||
@@ -61,6 +67,12 @@ public class JsIrInvalidationPerFileTestGenerated extends AbstractJsIrInvalidati
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classFunctionsAndFields/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classWithJsExport")
|
||||
public void testClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionConstVal")
|
||||
public void testCompanionConstVal() throws Exception {
|
||||
@@ -301,6 +313,12 @@ public class JsIrInvalidationPerFileTestGenerated extends AbstractJsIrInvalidati
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceWithJsExport")
|
||||
public void testInterfaceWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCode")
|
||||
public void testJsCode() throws Exception {
|
||||
@@ -349,6 +367,12 @@ public class JsIrInvalidationPerFileTestGenerated extends AbstractJsIrInvalidati
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsModuleAnnotationOnObjectWithUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsName")
|
||||
public void testJsName() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsName/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinTest")
|
||||
public void testKotlinTest() throws Exception {
|
||||
|
||||
Generated
+24
@@ -20,6 +20,12 @@ import java.util.regex.Pattern;
|
||||
@TestMetadata("js/js.translator/testData/incremental/invalidation")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsIrInvalidationPerModuleTestGenerated extends AbstractJsIrInvalidationPerModuleTest {
|
||||
@Test
|
||||
@TestMetadata("abstractClassWithJsExport")
|
||||
public void testAbstractClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/abstractClassWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("addUpdateRemoveDependentFile")
|
||||
public void testAddUpdateRemoveDependentFile() throws Exception {
|
||||
@@ -61,6 +67,12 @@ public class JsIrInvalidationPerModuleTestGenerated extends AbstractJsIrInvalida
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classFunctionsAndFields/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classWithJsExport")
|
||||
public void testClassWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/classWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("companionConstVal")
|
||||
public void testCompanionConstVal() throws Exception {
|
||||
@@ -301,6 +313,12 @@ public class JsIrInvalidationPerModuleTestGenerated extends AbstractJsIrInvalida
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithDefaultParams/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceWithJsExport")
|
||||
public void testInterfaceWithJsExport() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/interfaceWithJsExport/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsCode")
|
||||
public void testJsCode() throws Exception {
|
||||
@@ -349,6 +367,12 @@ public class JsIrInvalidationPerModuleTestGenerated extends AbstractJsIrInvalida
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsModuleAnnotationOnObjectWithUsage/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsName")
|
||||
public void testJsName() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/jsName/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinTest")
|
||||
public void testKotlinTest() throws Exception {
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
abstract class Foo {
|
||||
abstract fun foo(): String
|
||||
fun bar(): String = "K"
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
@JsExport
|
||||
abstract class Foo {
|
||||
abstract fun foo(): String
|
||||
fun bar(): String = "K"
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
abstract class Foo {
|
||||
abstract fun foo(): String
|
||||
fun bar(): String = "K"
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
STEP 0:
|
||||
modifications:
|
||||
U : lib.0.kt -> lib.kt
|
||||
added file: lib.kt
|
||||
STEP 1:
|
||||
modifications:
|
||||
U : lib.1.kt -> lib.kt
|
||||
modified ir: lib.kt
|
||||
STEP 2:
|
||||
modifications:
|
||||
U : lib.2.kt -> lib.kt
|
||||
modified ir: lib.kt
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class FooImpl : Foo() {
|
||||
override fun foo() = "O"
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
STEP 0:
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : lib.0.kt -> lib.kt
|
||||
added file: lib.kt
|
||||
STEP 1:
|
||||
dependencies: lib1
|
||||
updated imports: lib.kt
|
||||
STEP 2:
|
||||
dependencies: lib1
|
||||
updated imports: lib.kt
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
fun box(): String {
|
||||
val x = FooImpl()
|
||||
return x.foo() + x.bar()
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
STEP 0:
|
||||
dependencies: lib1, lib2
|
||||
added file: m.kt
|
||||
STEP 1:
|
||||
dependencies: lib1, lib2
|
||||
updated imports: m.kt
|
||||
STEP 2:
|
||||
dependencies: lib1, lib2
|
||||
updated imports: m.kt
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib1, lib2, main
|
||||
dirty js files: lib1/lib, lib2/lib, main/m, main/m.export, main
|
||||
STEP 1:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib1, lib2, main
|
||||
dirty js files: lib1/lib, lib1/lib.export, lib1, lib2/lib, main/m
|
||||
STEP 2:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib1, lib2, main
|
||||
dirty js files: lib1/lib, lib2/lib, main/m
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
open class Foo {
|
||||
open fun foo(): String = "Fail"
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
@JsExport
|
||||
open class Foo {
|
||||
open fun foo(): String = "Fail"
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
open class Foo {
|
||||
open fun foo(): String = "Fail"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
STEP 0:
|
||||
modifications:
|
||||
U : lib.0.kt -> lib.kt
|
||||
added file: lib.kt
|
||||
STEP 1:
|
||||
modifications:
|
||||
U : lib.1.kt -> lib.kt
|
||||
modified ir: lib.kt
|
||||
STEP 2:
|
||||
modifications:
|
||||
U : lib.2.kt -> lib.kt
|
||||
modified ir: lib.kt
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class FooImpl : Foo() {
|
||||
override fun foo() = "OK"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
STEP 0:
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : lib.0.kt -> lib.kt
|
||||
added file: lib.kt
|
||||
STEP 1:
|
||||
dependencies: lib1
|
||||
updated imports: lib.kt
|
||||
STEP 2:
|
||||
dependencies: lib1
|
||||
updated imports: lib.kt
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun box(): String {
|
||||
return FooImpl().foo()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
STEP 0:
|
||||
dependencies: lib1, lib2
|
||||
added file: m.kt
|
||||
STEP 1:
|
||||
dependencies: lib1, lib2
|
||||
updated imports: m.kt
|
||||
STEP 2:
|
||||
dependencies: lib1, lib2
|
||||
updated imports: m.kt
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib1, lib2, main
|
||||
dirty js files: lib1/lib, lib2/lib, main/m, main/m.export, main
|
||||
STEP 1:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib1, lib2, main
|
||||
dirty js files: lib1/lib, lib1/lib.export, lib1, lib2/lib, main/m
|
||||
STEP 2:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib1, lib2, main
|
||||
dirty js files: lib1/lib, lib2/lib, main/m
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
interface Foo {
|
||||
fun foo(): String
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
@JsExport
|
||||
interface Foo {
|
||||
fun foo(): String
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
interface Foo {
|
||||
fun foo(): String = "OK"
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
@JsExport
|
||||
interface Foo {
|
||||
fun foo(): String = "OK"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
STEP 0:
|
||||
modifications:
|
||||
U : lib.0.kt -> lib.kt
|
||||
added file: lib.kt
|
||||
STEP 1:
|
||||
modifications:
|
||||
U : lib.1.kt -> lib.kt
|
||||
modified ir: lib.kt
|
||||
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
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class FooImpl : Foo {
|
||||
override fun foo() = "OK"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
class FooImpl : Foo
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
STEP 0:
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : lib.0.kt -> lib.kt
|
||||
added file: lib.kt
|
||||
STEP 1:
|
||||
dependencies: lib1
|
||||
updated imports: lib.kt
|
||||
STEP 2:
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : lib.2.kt -> lib.kt
|
||||
modified ir: lib.kt
|
||||
STEP 3:
|
||||
dependencies: lib1
|
||||
updated imports: lib.kt
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun box(): String {
|
||||
return FooImpl().foo()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
STEP 0:
|
||||
dependencies: lib1, lib2
|
||||
added file: m.kt
|
||||
STEP 1:
|
||||
dependencies: lib1, lib2
|
||||
updated imports: m.kt
|
||||
STEP 2:
|
||||
dependencies: lib1, lib2
|
||||
updated imports: m.kt
|
||||
STEP 3:
|
||||
dependencies: lib1, lib2
|
||||
updated imports: m.kt
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib1, lib2, main
|
||||
dirty js files: lib1/lib, lib2/lib, main/m, main/m.export, main
|
||||
STEP 1:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib1, lib2, main
|
||||
dirty js files: lib1/lib, lib1/lib.export, lib1, lib2/lib, main/m
|
||||
STEP 2:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib1, lib2, main
|
||||
dirty js files: lib1/lib, lib2/lib, main/m
|
||||
STEP 3:
|
||||
libs: lib1, lib2, main
|
||||
dirty js modules: lib1, lib2, main
|
||||
dirty js files: lib1/lib, lib1/lib.export, lib2/lib, main/m
|
||||
@@ -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