Don't write synthetic arguments to LVT

This commit is contained in:
Mikhael Bogdanov
2019-11-15 13:21:01 +01:00
parent f264942bf9
commit 3196893166
4 changed files with 28 additions and 1 deletions
@@ -252,7 +252,9 @@ class ExpressionCodegen(
writeValueParameterInLocalVariableTable(extensionReceiverParameter, startLabel, endLabel, true)
}
for (param in irFunction.valueParameters) {
writeValueParameterInLocalVariableTable(param, startLabel, endLabel, false)
if (!param.origin.isSynthetic) {
writeValueParameterInLocalVariableTable(param, startLabel, endLabel, false)
}
}
}
@@ -0,0 +1,15 @@
// FILE: Foo.kt
fun foo(param: String = "123") {}
//TODO: align backends
// JVM_TEMPLATES
// 1 LOCALVARIABLE param
// 1 LOCALVARIABLE
// JVM_IR_TEMPLATES
// 2 LOCALVARIABLE param
// 2 LOCALVARIABLE
@@ -1584,6 +1584,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
public void testNoEmptyArray() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noEmptyArray.kt");
}
@TestMetadata("noSyntheticParameters.kt")
public void testNoSyntheticParameters() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noSyntheticParameters.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/directInvoke")
@@ -1539,6 +1539,11 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
public void testNoEmptyArray() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noEmptyArray.kt");
}
@TestMetadata("noSyntheticParameters.kt")
public void testNoSyntheticParameters() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noSyntheticParameters.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/directInvoke")