[FIR] Count alias reference with type arguments as qualifier w/out value
This commit is contained in:
@@ -207,6 +207,7 @@ class FirCallResolver(
|
|||||||
referencedSymbol is FirClassLikeSymbol<*> -> {
|
referencedSymbol is FirClassLikeSymbol<*> -> {
|
||||||
val classId = referencedSymbol.classId
|
val classId = referencedSymbol.classId
|
||||||
return FirResolvedQualifierImpl(nameReference.source, classId.packageFqName, classId.relativeClassName).apply {
|
return FirResolvedQualifierImpl(nameReference.source, classId.packageFqName, classId.relativeClassName).apply {
|
||||||
|
typeArguments.addAll(qualifiedAccess.typeArguments)
|
||||||
resultType = if (classId.isLocal) {
|
resultType = if (classId.isLocal) {
|
||||||
typeForQualifierByDeclaration(referencedSymbol.fir, resultType, session)
|
typeForQualifierByDeclaration(referencedSymbol.fir, resultType, session)
|
||||||
?: resultType.resolvedTypeFromPrototype(
|
?: resultType.resolvedTypeFromPrototype(
|
||||||
|
|||||||
@@ -320,7 +320,9 @@ fun BodyResolveComponents.typeForQualifier(resolvedQualifier: FirResolvedQualifi
|
|||||||
val classSymbol = symbolProvider.getClassLikeSymbolByFqName(classId)
|
val classSymbol = symbolProvider.getClassLikeSymbolByFqName(classId)
|
||||||
?: return FirErrorTypeRefImpl(source = null, diagnostic = FirSimpleDiagnostic("No type for qualifier", DiagnosticKind.Other))
|
?: return FirErrorTypeRefImpl(source = null, diagnostic = FirSimpleDiagnostic("No type for qualifier", DiagnosticKind.Other))
|
||||||
val declaration = classSymbol.phasedFir
|
val declaration = classSymbol.phasedFir
|
||||||
typeForQualifierByDeclaration(declaration, resultType, session)?.let { return it }
|
if (declaration !is FirTypeAlias || resolvedQualifier.typeArguments.isEmpty()) {
|
||||||
|
typeForQualifierByDeclaration(declaration, resultType, session)?.let { return it }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// TODO: Handle no value type here
|
// TODO: Handle no value type here
|
||||||
return resultType.resolvedTypeFromPrototype(
|
return resultType.resolvedTypeFromPrototype(
|
||||||
|
|||||||
+1
-1
@@ -6,5 +6,5 @@ class C<T1, T2> {
|
|||||||
|
|
||||||
typealias C2<T> = C<T, T>
|
typealias C2<T> = C<T, T>
|
||||||
|
|
||||||
val test1: String = C2<String>.OK
|
val test1: String = C2<String>.<!UNRESOLVED_REFERENCE!>OK<!>
|
||||||
val test2: String = C2.OK
|
val test2: String = C2.OK
|
||||||
|
|||||||
Reference in New Issue
Block a user