K2: add a black box test to confirm KT-55705 now works properly

This commit is contained in:
Mikhail Glukhikh
2023-11-13 22:33:05 +01:00
committed by Space Team
parent f2ef41dbbd
commit 4b1368409d
20 changed files with 138 additions and 0 deletions
@@ -51176,6 +51176,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -51176,6 +51176,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -50601,6 +50601,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -50601,6 +50601,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -50601,6 +50601,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -0,0 +1,25 @@
// ISSUE: KT-55705
interface A<T> {
fun foo(x: T?) {}
}
interface B : A<String> {
override fun foo(x: String?)
}
fun <T> bar(x: A<in T>) {
if (x is B) {
// The code should be green
x.foo(null)
}
}
fun box(): String {
bar<String>(
object : B {
override fun foo(x: String?) {}
}
)
return "OK"
}
@@ -47607,6 +47607,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -50601,6 +50601,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -50601,6 +50601,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -40711,6 +40711,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericIntersection.kt");
@@ -34995,6 +34995,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -34995,6 +34995,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -34995,6 +34995,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -34995,6 +34995,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -38681,6 +38681,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -39679,6 +39679,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -38183,6 +38183,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -38682,6 +38682,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -34671,6 +34671,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
@@ -34671,6 +34671,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest
runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt");
}
@Test
@TestMetadata("genericInheritanceWithNonGenericNoAmbiguity.kt")
public void testGenericInheritanceWithNonGenericNoAmbiguity() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/genericInheritanceWithNonGenericNoAmbiguity.kt");
}
@Test
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {