Merge-request: KT-MR-8229 Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
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.