Add test for KT-41254
It was fixed along with #KT-41005
This commit is contained in:
Generated
+5
@@ -12627,6 +12627,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUniForNullableLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt")
|
||||
public void testNoCoercionToUnitWithEqualityConstraintForNullableReturnType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noNothingValueInsideSpecialCall.kt")
|
||||
public void testNoNothingValueInsideSpecialCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/noNothingValueInsideSpecialCall.kt");
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class Inv<T>(val x: T?)
|
||||
|
||||
fun <R> foo(f: () -> R?): Inv<R> {
|
||||
val r = f()
|
||||
if (r != null) throw Exception("fail, result is not null: $r")
|
||||
return Inv(r)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val r: Inv<Unit> = foo { if (false) Unit else null }
|
||||
return "OK"
|
||||
}
|
||||
+5
@@ -13852,6 +13852,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUniForNullableLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt")
|
||||
public void testNoCoercionToUnitWithEqualityConstraintForNullableReturnType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noNothingValueInsideSpecialCall.kt")
|
||||
public void testNoNothingValueInsideSpecialCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/noNothingValueInsideSpecialCall.kt");
|
||||
|
||||
+5
@@ -13852,6 +13852,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUniForNullableLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt")
|
||||
public void testNoCoercionToUnitWithEqualityConstraintForNullableReturnType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noNothingValueInsideSpecialCall.kt")
|
||||
public void testNoNothingValueInsideSpecialCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/noNothingValueInsideSpecialCall.kt");
|
||||
|
||||
+5
@@ -12627,6 +12627,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUniForNullableLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt")
|
||||
public void testNoCoercionToUnitWithEqualityConstraintForNullableReturnType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noNothingValueInsideSpecialCall.kt")
|
||||
public void testNoNothingValueInsideSpecialCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/noNothingValueInsideSpecialCall.kt");
|
||||
|
||||
Generated
+5
@@ -10807,6 +10807,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUniForNullableLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt")
|
||||
public void testNoCoercionToUnitWithEqualityConstraintForNullableReturnType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("plusAssignInsideLambda.kt")
|
||||
public void testPlusAssignInsideLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
||||
|
||||
Generated
+5
@@ -10807,6 +10807,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUniForNullableLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt")
|
||||
public void testNoCoercionToUnitWithEqualityConstraintForNullableReturnType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("plusAssignInsideLambda.kt")
|
||||
public void testPlusAssignInsideLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
||||
|
||||
+5
@@ -10872,6 +10872,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUniForNullableLambdaReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt")
|
||||
public void testNoCoercionToUnitWithEqualityConstraintForNullableReturnType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/noCoercionToUnitWithEqualityConstraintForNullableReturnType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("plusAssignInsideLambda.kt")
|
||||
public void testPlusAssignInsideLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
|
||||
|
||||
Reference in New Issue
Block a user