Add a test

This commit is contained in:
Georgy Bronnikov
2018-12-24 12:00:29 +03:00
parent cb757f1cbc
commit 68f9f4b3b5
6 changed files with 46 additions and 0 deletions
@@ -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"
}
@@ -1251,6 +1251,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
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")
public void testFakeOverrideOfTraitImpl() throws Exception {
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
@@ -1251,6 +1251,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
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")
public void testFakeOverrideOfTraitImpl() throws Exception {
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
@@ -1251,6 +1251,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
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")
public void testFakeOverrideOfTraitImpl() throws Exception {
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
@@ -956,6 +956,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
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")
public void testFakeOverrideOfTraitImpl() throws Exception {
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");
@@ -956,6 +956,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
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")
public void testFakeOverrideOfTraitImpl() throws Exception {
runTest("compiler/testData/codegen/box/bridges/fakeOverrideOfTraitImpl.kt");