JVM IR: add test for complex generic diamond hierarchy
This is a test for KT-43832, which is fixed in the previous commit.
This commit is contained in:
Generated
+5
@@ -31636,6 +31636,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/traits/doubleDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("doubleGenericDiamond.kt")
|
||||
public void testDoubleGenericDiamond() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/doubleGenericDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericMethod.kt")
|
||||
public void testGenericMethod() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/genericMethod.kt");
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// FILE: lib.kt
|
||||
|
||||
var result = ""
|
||||
|
||||
interface Left
|
||||
interface Right
|
||||
class Bottom : Left, Right
|
||||
|
||||
interface A<T> {
|
||||
fun f(): T? {
|
||||
result = "A"
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
interface B<T : Left> : A<T> {
|
||||
override fun f(): T? {
|
||||
result = "B"
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
abstract class C<T> : A<T>
|
||||
|
||||
abstract class D<T : Right> : C<T>()
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
class Z : D<Bottom>(), B<Bottom>
|
||||
|
||||
fun box(): String {
|
||||
Z().f()
|
||||
return if (result == "B") "OK" else "Fail: $result"
|
||||
}
|
||||
+5
@@ -33407,6 +33407,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/traits/doubleDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("doubleGenericDiamond.kt")
|
||||
public void testDoubleGenericDiamond() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/doubleGenericDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericMethod.kt")
|
||||
public void testGenericMethod() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/genericMethod.kt");
|
||||
|
||||
+5
@@ -31041,6 +31041,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/traits/doubleDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("doubleGenericDiamond.kt")
|
||||
public void testDoubleGenericDiamond() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/doubleGenericDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericMethod.kt")
|
||||
public void testGenericMethod() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/genericMethod.kt");
|
||||
|
||||
+5
@@ -31636,6 +31636,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/traits/doubleDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("doubleGenericDiamond.kt")
|
||||
public void testDoubleGenericDiamond() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/doubleGenericDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericMethod.kt")
|
||||
public void testGenericMethod() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/genericMethod.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -25592,6 +25592,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/traits/doubleDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("doubleGenericDiamond.kt")
|
||||
public void testDoubleGenericDiamond() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/doubleGenericDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericMethod.kt")
|
||||
public void testGenericMethod() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/genericMethod.kt");
|
||||
|
||||
Generated
+5
@@ -25592,6 +25592,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/traits/doubleDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("doubleGenericDiamond.kt")
|
||||
public void testDoubleGenericDiamond() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/doubleGenericDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericMethod.kt")
|
||||
public void testGenericMethod() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/genericMethod.kt");
|
||||
|
||||
Generated
+5
@@ -25592,6 +25592,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/traits/doubleDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("doubleGenericDiamond.kt")
|
||||
public void testDoubleGenericDiamond() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/doubleGenericDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericMethod.kt")
|
||||
public void testGenericMethod() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/genericMethod.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+5
@@ -13890,6 +13890,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/traits/doubleDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("doubleGenericDiamond.kt")
|
||||
public void testDoubleGenericDiamond() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/doubleGenericDiamond.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericMethod.kt")
|
||||
public void testGenericMethod() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/traits/genericMethod.kt");
|
||||
|
||||
Reference in New Issue
Block a user