mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
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
@@ -16610,6 +16610,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
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
|
||||
@TestMetadata("kt785.kt")
|
||||
public void testKt785() throws Exception {
|
||||
|
||||
@@ -394,7 +394,7 @@ public class ExpressionTypingServices {
|
||||
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);
|
||||
if (typeInfo != null) return typeInfo;
|
||||
}
|
||||
|
||||
19
compiler/testData/codegen/box/functions/kt48058.kt
vendored
Normal file
19
compiler/testData/codegen/box/functions/kt48058.kt
vendored
Normal file
@@ -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"
|
||||
}
|
||||
@@ -16490,6 +16490,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
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
|
||||
@TestMetadata("kt785.kt")
|
||||
public void testKt785() throws Exception {
|
||||
|
||||
@@ -16610,6 +16610,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
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
|
||||
@TestMetadata("kt785.kt")
|
||||
public void testKt785() throws Exception {
|
||||
|
||||
@@ -13614,6 +13614,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
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")
|
||||
public void testKt785() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
||||
|
||||
@@ -11983,6 +11983,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
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")
|
||||
public void testKt785() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
||||
|
||||
@@ -11389,6 +11389,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
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")
|
||||
public void testKt785() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
||||
|
||||
@@ -11389,6 +11389,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
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")
|
||||
public void testKt785() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/functions/kt785.kt");
|
||||
|
||||
Reference in New Issue
Block a user