[FIR2IR] Expand typealias in callable reference receiver generation
^KT-56750 Fixed
This commit is contained in:
committed by
Space Team
parent
3ec032212c
commit
d00513599b
+3
-2
@@ -698,10 +698,11 @@ class CallAndReferenceGenerator(
|
||||
): IrExpression? {
|
||||
val classSymbol = (qualifier.typeRef.coneType as? ConeClassLikeType)?.lookupTag?.toSymbol(session)
|
||||
if (callableReferenceAccess != null && classSymbol is FirRegularClassSymbol) {
|
||||
val classIdMatched = classSymbol.classId == qualifier.classId
|
||||
val classId = qualifier.symbol?.fullyExpandedClass(session)?.classId
|
||||
val classIdMatched = classSymbol.classId == classId
|
||||
if (!classIdMatched) {
|
||||
// Check whether we need get companion object as dispatch receiver
|
||||
if (!classSymbol.fir.isCompanion || classSymbol.classId.outerClassId != qualifier.classId) {
|
||||
if (!classSymbol.fir.isCompanion || classSymbol.classId.outerClassId != classId) {
|
||||
return null
|
||||
}
|
||||
val resolvedReference = callableReferenceAccess.calleeReference as FirResolvedNamedReference
|
||||
|
||||
+6
@@ -3794,6 +3794,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/callableReference/bound/syntheticExtensionOnLHS.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeAliasObjectBoundReference.kt")
|
||||
public void testTypeAliasObjectBoundReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/bound/typeAliasObjectBoundReference.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/callableReference/bound/equals")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -3794,6 +3794,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/callableReference/bound/syntheticExtensionOnLHS.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeAliasObjectBoundReference.kt")
|
||||
public void testTypeAliasObjectBoundReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/callableReference/bound/typeAliasObjectBoundReference.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/callableReference/bound/equals")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
Reference in New Issue
Block a user