Remove obsolete assertion in ExpressionCodegen
With the mangling added in 488418d960, there's no longer any risk in
writing "special" function name ("<anonymous>" in this case) to the
local variable table.
#KT-34356 Fixed
This commit is contained in:
@@ -1447,9 +1447,6 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
|||||||
leaveTasks.add(answer -> {
|
leaveTasks.add(answer -> {
|
||||||
int index = myFrameMap.leave(functionDescriptor);
|
int index = myFrameMap.leave(functionDescriptor);
|
||||||
|
|
||||||
assert !functionDescriptor.getName().isSpecial()
|
|
||||||
: "Local variable should be generated only for function with name: " + localFunction.getText();
|
|
||||||
|
|
||||||
String functionIndex = StringsKt.substringAfterLast(type.getInternalName(), '$', "");
|
String functionIndex = StringsKt.substringAfterLast(type.getInternalName(), '$', "");
|
||||||
assert !functionIndex.isEmpty();
|
assert !functionIndex.isEmpty();
|
||||||
|
|
||||||
|
|||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
fun <T> block(block: () -> T): T = block()
|
||||||
|
fun foo() {}
|
||||||
|
|
||||||
|
fun test(): () -> Unit = block { fun() = foo() }
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
test()
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
+5
@@ -11591,6 +11591,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt");
|
runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("insideGenericLambda.kt")
|
||||||
|
public void testInsideGenericLambda() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/functionExpression/insideGenericLambda.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("underscoreParameters.kt")
|
@TestMetadata("underscoreParameters.kt")
|
||||||
public void testUnderscoreParameters() throws Exception {
|
public void testUnderscoreParameters() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/functions/functionExpression/underscoreParameters.kt");
|
runTest("compiler/testData/codegen/box/functions/functionExpression/underscoreParameters.kt");
|
||||||
|
|||||||
+5
@@ -11591,6 +11591,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt");
|
runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("insideGenericLambda.kt")
|
||||||
|
public void testInsideGenericLambda() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/functionExpression/insideGenericLambda.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("underscoreParameters.kt")
|
@TestMetadata("underscoreParameters.kt")
|
||||||
public void testUnderscoreParameters() throws Exception {
|
public void testUnderscoreParameters() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/functions/functionExpression/underscoreParameters.kt");
|
runTest("compiler/testData/codegen/box/functions/functionExpression/underscoreParameters.kt");
|
||||||
|
|||||||
+5
@@ -10471,6 +10471,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt");
|
runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("insideGenericLambda.kt")
|
||||||
|
public void testInsideGenericLambda() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/functionExpression/insideGenericLambda.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("underscoreParameters.kt")
|
@TestMetadata("underscoreParameters.kt")
|
||||||
public void testUnderscoreParameters() throws Exception {
|
public void testUnderscoreParameters() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/functions/functionExpression/underscoreParameters.kt");
|
runTest("compiler/testData/codegen/box/functions/functionExpression/underscoreParameters.kt");
|
||||||
|
|||||||
Generated
+5
@@ -9016,6 +9016,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt");
|
runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("insideGenericLambda.kt")
|
||||||
|
public void testInsideGenericLambda() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/functionExpression/insideGenericLambda.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("underscoreParameters.kt")
|
@TestMetadata("underscoreParameters.kt")
|
||||||
public void testUnderscoreParameters() throws Exception {
|
public void testUnderscoreParameters() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/functions/functionExpression/underscoreParameters.kt");
|
runTest("compiler/testData/codegen/box/functions/functionExpression/underscoreParameters.kt");
|
||||||
|
|||||||
+5
@@ -10101,6 +10101,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt");
|
runTest("compiler/testData/codegen/box/functions/functionExpression/functionLiteralExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("insideGenericLambda.kt")
|
||||||
|
public void testInsideGenericLambda() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/functions/functionExpression/insideGenericLambda.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("underscoreParameters.kt")
|
@TestMetadata("underscoreParameters.kt")
|
||||||
public void testUnderscoreParameters() throws Exception {
|
public void testUnderscoreParameters() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/functions/functionExpression/underscoreParameters.kt");
|
runTest("compiler/testData/codegen/box/functions/functionExpression/underscoreParameters.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user