FIR: expect getClassLikeSymbolByFqName to return null for local classes
This commit is contained in:
+4
-6
@@ -342,18 +342,16 @@ class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransformer) :
|
|||||||
val typeOfExpression = when (val lhs = transformedGetClassCall.argument) {
|
val typeOfExpression = when (val lhs = transformedGetClassCall.argument) {
|
||||||
is FirResolvedQualifier -> {
|
is FirResolvedQualifier -> {
|
||||||
val classId = lhs.classId
|
val classId = lhs.classId
|
||||||
if (classId != null) {
|
classId?.let { classId ->
|
||||||
val symbol = symbolProvider.getClassLikeSymbolByFqName(classId)!!
|
val symbol = symbolProvider.getClassLikeSymbolByFqName(classId)
|
||||||
// TODO: Unify logic?
|
// TODO: Unify logic?
|
||||||
symbol.constructType(
|
symbol?.constructType(
|
||||||
Array(symbol.phasedFir.typeParameters.size) {
|
Array(symbol.phasedFir.typeParameters.size) {
|
||||||
ConeStarProjection
|
ConeStarProjection
|
||||||
},
|
},
|
||||||
isNullable = false
|
isNullable = false
|
||||||
)
|
)
|
||||||
} else {
|
} ?: lhs.resultType.coneTypeUnsafe<ConeKotlinType>()
|
||||||
lhs.resultType.coneTypeUnsafe<ConeKotlinType>()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else -> lhs.resultType.coneTypeUnsafe<ConeKotlinType>()
|
else -> lhs.resultType.coneTypeUnsafe<ConeKotlinType>()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-3
@@ -27,9 +27,7 @@ abstract class FirAbstractImportingScope(
|
|||||||
|
|
||||||
private fun getStaticsScope(classId: ClassId): FirScope? {
|
private fun getStaticsScope(classId: ClassId): FirScope? {
|
||||||
provider.getClassUseSiteMemberScope(classId, session, scopeSession)?.let { return it }
|
provider.getClassUseSiteMemberScope(classId, session, scopeSession)?.let { return it }
|
||||||
|
val symbol = provider.getClassLikeSymbolByFqName(classId) ?: return null
|
||||||
|
|
||||||
val symbol = provider.getClassLikeSymbolByFqName(classId) ?: error("No scope/symbol for $classId")
|
|
||||||
if (symbol is FirTypeAliasSymbol) {
|
if (symbol is FirTypeAliasSymbol) {
|
||||||
val expansionSymbol = symbol.fir.expandedConeType?.lookupTag?.toSymbol(session)
|
val expansionSymbol = symbol.fir.expandedConeType?.lookupTag?.toSymbol(session)
|
||||||
if (expansionSymbol != null) {
|
if (expansionSymbol != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user