Add a test
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
|||||||
|
// KT-4145
|
||||||
|
|
||||||
|
interface A {
|
||||||
|
fun foo(): Any
|
||||||
|
}
|
||||||
|
|
||||||
|
interface B {
|
||||||
|
fun foo(): String = "A"
|
||||||
|
}
|
||||||
|
|
||||||
|
open class D: B
|
||||||
|
|
||||||
|
open class C: D(), A
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val a: A = C()
|
||||||
|
if (a.foo() != "A") return "Fail 1"
|
||||||
|
if ((a as B).foo() != "A") return "Fail 2"
|
||||||
|
if ((a as C).foo() != "A") return "Fail 3"
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
+5
@@ -1251,6 +1251,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/bridges/fakeGenericCovariantOverrideWithDelegation.kt");
|
runTest("compiler/testData/codegen/box/bridges/fakeGenericCovariantOverrideWithDelegation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fakeOverrideFromInterfaceThroughIntermediateClass.kt")
|
||||||
|
public void testFakeOverrideFromInterfaceThroughIntermediateClass() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/bridges/fakeOverrideFromInterfaceThroughIntermediateClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("fakeOverrideOfTraitImpl.kt")
|
@TestMetadata("fakeOverrideOfTraitImpl.kt")
|
||||||
public void testFakeOverrideOfTraitImpl() throws Exception {
|
public void testFakeOverrideOfTraitImpl() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
|
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
|
||||||
|
|||||||
+5
@@ -1251,6 +1251,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/bridges/fakeGenericCovariantOverrideWithDelegation.kt");
|
runTest("compiler/testData/codegen/box/bridges/fakeGenericCovariantOverrideWithDelegation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fakeOverrideFromInterfaceThroughIntermediateClass.kt")
|
||||||
|
public void testFakeOverrideFromInterfaceThroughIntermediateClass() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/bridges/fakeOverrideFromInterfaceThroughIntermediateClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("fakeOverrideOfTraitImpl.kt")
|
@TestMetadata("fakeOverrideOfTraitImpl.kt")
|
||||||
public void testFakeOverrideOfTraitImpl() throws Exception {
|
public void testFakeOverrideOfTraitImpl() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
|
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
|
||||||
|
|||||||
+5
@@ -1251,6 +1251,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/bridges/fakeGenericCovariantOverrideWithDelegation.kt");
|
runTest("compiler/testData/codegen/box/bridges/fakeGenericCovariantOverrideWithDelegation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fakeOverrideFromInterfaceThroughIntermediateClass.kt")
|
||||||
|
public void testFakeOverrideFromInterfaceThroughIntermediateClass() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/bridges/fakeOverrideFromInterfaceThroughIntermediateClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("fakeOverrideOfTraitImpl.kt")
|
@TestMetadata("fakeOverrideOfTraitImpl.kt")
|
||||||
public void testFakeOverrideOfTraitImpl() throws Exception {
|
public void testFakeOverrideOfTraitImpl() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
|
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
|
||||||
|
|||||||
+5
@@ -956,6 +956,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/bridges/fakeGenericCovariantOverrideWithDelegation.kt");
|
runTest("compiler/testData/codegen/box/bridges/fakeGenericCovariantOverrideWithDelegation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fakeOverrideFromInterfaceThroughIntermediateClass.kt")
|
||||||
|
public void testFakeOverrideFromInterfaceThroughIntermediateClass() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/bridges/fakeOverrideFromInterfaceThroughIntermediateClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("fakeOverrideOfTraitImpl.kt")
|
@TestMetadata("fakeOverrideOfTraitImpl.kt")
|
||||||
public void testFakeOverrideOfTraitImpl() throws Exception {
|
public void testFakeOverrideOfTraitImpl() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
|
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
|
||||||
|
|||||||
+5
@@ -956,6 +956,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/bridges/fakeGenericCovariantOverrideWithDelegation.kt");
|
runTest("compiler/testData/codegen/box/bridges/fakeGenericCovariantOverrideWithDelegation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("fakeOverrideFromInterfaceThroughIntermediateClass.kt")
|
||||||
|
public void testFakeOverrideFromInterfaceThroughIntermediateClass() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/bridges/fakeOverrideFromInterfaceThroughIntermediateClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("fakeOverrideOfTraitImpl.kt")
|
@TestMetadata("fakeOverrideOfTraitImpl.kt")
|
||||||
public void testFakeOverrideOfTraitImpl() throws Exception {
|
public void testFakeOverrideOfTraitImpl() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
|
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user