psi2ir: handle 'this' as reference to a super companion object
In super class constructor arguments, 'this' can be resolved as a reference to a companion object of a superclass. This breaks an assumption in psi2ir that 'this' can only refer to some receiver from the current scope. If 'this' refers to an 'object' (including 'companion obejct'), and we are not inside the corresponding class scope, then 'this' represents a reference to a singleton instance "by name" (represented as IrGetObjectValue).
This commit is contained in:
@@ -1132,6 +1132,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
|
||||
runTest("compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("thisReferenceBeforeClassDeclared.kt")
|
||||
public void testThisReferenceBeforeClassDeclared() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throw.kt")
|
||||
public void testThrow() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/expressions/throw.kt");
|
||||
|
||||
Reference in New Issue
Block a user