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:
Generated
+5
@@ -8177,6 +8177,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
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");
|
||||
|
||||
+5
@@ -9262,6 +9262,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
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