Capture flexible intersection types properly: take into account both bounds and use the same captured arguments for them
^KT-41693 Fixed
This commit is contained in:
Generated
+5
@@ -12692,6 +12692,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("subtypingOfIntersectionIltInsideFlexible.kt")
|
||||
public void testSubtypingOfIntersectionIltInsideFlexible() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsafeVarianceCodegen.kt")
|
||||
public void testUnsafeVarianceCodegen() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
|
||||
// FILE: Bar.java
|
||||
public class Bar {
|
||||
public static String bar() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun foo(): Any? {
|
||||
return if (true) {
|
||||
if (true) {
|
||||
Bar.bar()
|
||||
} else {
|
||||
1
|
||||
}
|
||||
} else {
|
||||
1
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String? {
|
||||
foo()
|
||||
return "OK"
|
||||
}
|
||||
+5
@@ -13917,6 +13917,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("subtypingOfIntersectionIltInsideFlexible.kt")
|
||||
public void testSubtypingOfIntersectionIltInsideFlexible() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsafeVarianceCodegen.kt")
|
||||
public void testUnsafeVarianceCodegen() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
||||
|
||||
+5
@@ -13917,6 +13917,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("subtypingOfIntersectionIltInsideFlexible.kt")
|
||||
public void testSubtypingOfIntersectionIltInsideFlexible() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsafeVarianceCodegen.kt")
|
||||
public void testUnsafeVarianceCodegen() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
||||
|
||||
+5
@@ -12692,6 +12692,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inference/referenceToCatchParameterFromLambdaExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("subtypingOfIntersectionIltInsideFlexible.kt")
|
||||
public void testSubtypingOfIntersectionIltInsideFlexible() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/subtypingOfIntersectionIltInsideFlexible.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unsafeVarianceCodegen.kt")
|
||||
public void testUnsafeVarianceCodegen() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");
|
||||
|
||||
Reference in New Issue
Block a user