JVM IR: generate enclosing constructor only for lambdas in initializers
There was a typo in JvmLocalClassPopupLowering which allowed the EnclosingMethod for lambdas and anonymous classes in initializers to become any function in a class, in case when there was no primary constructor in that class. E.g. in the added test, `getIrrelevantField` was the EnclosingMethod of the lambda class before this change.
This commit is contained in:
+5
@@ -469,6 +469,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/kt10259.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaInInitBlockNoPrimaryConstructor.kt")
|
||||
public void testLambdaInInitBlockNoPrimaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/lambdaInInitBlockNoPrimaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("transformedConstructor.kt")
|
||||
public void testTransformedConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/transformedConstructor.kt");
|
||||
|
||||
+5
@@ -439,6 +439,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/kt10259.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaInInitBlockNoPrimaryConstructor.kt")
|
||||
public void testLambdaInInitBlockNoPrimaryConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/lambdaInInitBlockNoPrimaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("transformedConstructor.kt")
|
||||
public void testTransformedConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inline/enclosingInfo/transformedConstructor.kt");
|
||||
|
||||
Reference in New Issue
Block a user