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:
Georgy Bronnikov
2019-10-15 12:20:02 +03:00
parent fa44cab9dc
commit ed6ca7d67e
7 changed files with 56 additions and 23 deletions
@@ -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");