K2: add a black box test to confirm KT-55705 now works properly
This commit is contained in:
committed by
Space Team
parent
f2ef41dbbd
commit
4b1368409d
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
+25
@@ -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"
|
||||
}
|
||||
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
+5
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user