Add a test to reveal flaw in call delegation with default implementations in interfaces.
This commit is contained in:
committed by
max-kammerer
parent
5cefd4e443
commit
cc6252098f
+16
@@ -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()
|
||||
}
|
||||
+5
@@ -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");
|
||||
|
||||
+5
@@ -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");
|
||||
|
||||
+5
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user