PSI2IR: Unify behavior for lambda return values with old back-end

See KT-35849.

1. When expected lambda return type is a type parameter, don't generate
introduce implicit casts (even if the corresponding type parameter has
an upper bound that would otherwise require such cast).

2. Do not generate implicit null check for lambda return value of
@EnhancedNullability type.
This commit is contained in:
Dmitry Petrov
2020-01-09 13:47:56 +03:00
parent c47e04ac8d
commit 4cf8203ce7
14 changed files with 368 additions and 22 deletions
@@ -14644,6 +14644,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inFunctionWithExpressionBodyWithJavaGeneric.kt");
}
@TestMetadata("inLambdaReturnWithExpectedType.kt")
public void testInLambdaReturnWithExpectedType() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inLambdaReturnWithExpectedType.kt");
}
@TestMetadata("inLocalFunctionWithExpressionBody.kt")
public void testInLocalFunctionWithExpressionBody() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inLocalFunctionWithExpressionBody.kt");