Add a test to reveal flaw in call delegation with default implementations in interfaces.

This commit is contained in:
Kristoffer Andersen
2019-09-25 15:25:22 +02:00
committed by max-kammerer
parent 5cefd4e443
commit cc6252098f
4 changed files with 31 additions and 0 deletions
@@ -0,0 +1,16 @@
// !JVM_DEFAULT_MODE: compatibility
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface A {
@JvmDefault
fun foo(x: String = "OK"): String {
return x
}
}
fun box(): String {
val x = object : A {}
return x.foo()
}
@@ -14718,6 +14718,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/defaultArgs.kt");
}
@TestMetadata("defaultArgsViaAnonymousObject.kt")
public void testDefaultArgsViaAnonymousObject() throws Exception {
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/defaultArgsViaAnonymousObject.kt");
}
@TestMetadata("inheritedJvmDefault.kt")
public void testInheritedJvmDefault() throws Exception {
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/inheritedJvmDefault.kt");
@@ -14718,6 +14718,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/defaultArgs.kt");
}
@TestMetadata("defaultArgsViaAnonymousObject.kt")
public void testDefaultArgsViaAnonymousObject() throws Exception {
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/defaultArgsViaAnonymousObject.kt");
}
@TestMetadata("inheritedJvmDefault.kt")
public void testInheritedJvmDefault() throws Exception {
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/inheritedJvmDefault.kt");
@@ -13603,6 +13603,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/defaultArgs.kt");
}
@TestMetadata("defaultArgsViaAnonymousObject.kt")
public void testDefaultArgsViaAnonymousObject() throws Exception {
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/defaultArgsViaAnonymousObject.kt");
}
@TestMetadata("inheritedJvmDefault.kt")
public void testInheritedJvmDefault() throws Exception {
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/inheritedJvmDefault.kt");