Create DONT_CARE type only for dependent lambdas (i.e. to be resolved through the type inference later)
^KT-47493 Fixed
This commit is contained in:
committed by
teamcityserver
parent
dbdc6176f0
commit
1966915e92
+6
@@ -16610,6 +16610,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt48058.kt")
|
||||||
|
public void testKt48058() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/kt48058.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt785.kt")
|
@TestMetadata("kt785.kt")
|
||||||
public void testKt785() throws Exception {
|
public void testKt785() throws Exception {
|
||||||
|
|||||||
+1
-1
@@ -394,7 +394,7 @@ public class ExpressionTypingServices {
|
|||||||
return blockLevelVisitor.getTypeInfo(statementExpression, context.replaceExpectedType(expectedType), true);
|
return blockLevelVisitor.getTypeInfo(statementExpression, context.replaceExpectedType(expectedType), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (KtPsiUtil.deparenthesize(statementExpression) instanceof KtLambdaExpression) {
|
if (KtPsiUtil.deparenthesize(statementExpression) instanceof KtLambdaExpression && context.contextDependency == ContextDependency.DEPENDENT) {
|
||||||
KotlinTypeInfo typeInfo = createDontCareTypeInfoForNILambda(statementExpression, context);
|
KotlinTypeInfo typeInfo = createDontCareTypeInfoForNILambda(statementExpression, context);
|
||||||
if (typeInfo != null) return typeInfo;
|
if (typeInfo != null) return typeInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// DONT_TARGET_EXACT_BACKEND: WASM
|
||||||
|
|
||||||
|
fun doCall(block: Any ):Int {
|
||||||
|
(block as () -> Unit)()
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test1() =
|
||||||
|
doCall {
|
||||||
|
try {}
|
||||||
|
finally {
|
||||||
|
{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
test1()
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
+6
@@ -16490,6 +16490,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt48058.kt")
|
||||||
|
public void testKt48058() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/kt48058.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt785.kt")
|
@TestMetadata("kt785.kt")
|
||||||
public void testKt785() throws Exception {
|
public void testKt785() throws Exception {
|
||||||
|
|||||||
+6
@@ -16610,6 +16610,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt48058.kt")
|
||||||
|
public void testKt48058() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/kt48058.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt785.kt")
|
@TestMetadata("kt785.kt")
|
||||||
public void testKt785() throws Exception {
|
public void testKt785() throws Exception {
|
||||||
|
|||||||
+5
@@ -13614,6 +13614,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt48058.kt")
|
||||||
|
public void testKt48058() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/kt48058.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt785.kt")
|
@TestMetadata("kt785.kt")
|
||||||
public void testKt785() throws Exception {
|
public void testKt785() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
||||||
|
|||||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -11983,6 +11983,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
|||||||
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt48058.kt")
|
||||||
|
public void testKt48058() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/kt48058.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt785.kt")
|
@TestMetadata("kt785.kt")
|
||||||
public void testKt785() throws Exception {
|
public void testKt785() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
||||||
|
|||||||
Generated
+5
@@ -11389,6 +11389,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt48058.kt")
|
||||||
|
public void testKt48058() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/kt48058.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt785.kt")
|
@TestMetadata("kt785.kt")
|
||||||
public void testKt785() throws Exception {
|
public void testKt785() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
||||||
|
|||||||
Generated
+5
@@ -11389,6 +11389,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
runTest("compiler/testData/codegen/box/functions/kt47527.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt48058.kt")
|
||||||
|
public void testKt48058() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/kt48058.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt785.kt")
|
@TestMetadata("kt785.kt")
|
||||||
public void testKt785() throws Exception {
|
public void testKt785() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user