JVM_IR: fix for SingletonReferencesLowering
When replacing an enum entry reference with `this`, you need to take `this` from the function's `dispatchReceiverParameter`, not the class's `thisReceiver`. Otherwise the code generator fails to find the reference among accessible variables.
This commit is contained in:
+5
@@ -10552,6 +10552,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/enum/ordinal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("refToThis.kt")
|
||||
public void testRefToThis() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/refToThis.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/simple.kt");
|
||||
|
||||
Reference in New Issue
Block a user