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) {
|
||||
is FirResolvedQualifier -> {
|
||||
val classId = lhs.classId
|
||||
if (classId != null) {
|
||||
val symbol = symbolProvider.getClassLikeSymbolByFqName(classId)!!
|
||||
classId?.let { classId ->
|
||||
val symbol = symbolProvider.getClassLikeSymbolByFqName(classId)
|
||||
// TODO: Unify logic?
|
||||
symbol.constructType(
|
||||
symbol?.constructType(
|
||||
Array(symbol.phasedFir.typeParameters.size) {
|
||||
ConeStarProjection
|
||||
},
|
||||
isNullable = false
|
||||
)
|
||||
} else {
|
||||
lhs.resultType.coneTypeUnsafe<ConeKotlinType>()
|
||||
}
|
||||
} ?: lhs.resultType.coneTypeUnsafe<ConeKotlinType>()
|
||||
}
|
||||
else -> lhs.resultType.coneTypeUnsafe<ConeKotlinType>()
|
||||
}
|
||||
|
||||
+1
-3
@@ -27,9 +27,7 @@ abstract class FirAbstractImportingScope(
|
||||
|
||||
private fun getStaticsScope(classId: ClassId): FirScope? {
|
||||
provider.getClassUseSiteMemberScope(classId, session, scopeSession)?.let { return it }
|
||||
|
||||
|
||||
val symbol = provider.getClassLikeSymbolByFqName(classId) ?: error("No scope/symbol for $classId")
|
||||
val symbol = provider.getClassLikeSymbolByFqName(classId) ?: return null
|
||||
if (symbol is FirTypeAliasSymbol) {
|
||||
val expansionSymbol = symbol.fir.expandedConeType?.lookupTag?.toSymbol(session)
|
||||
if (expansionSymbol != null) {
|
||||
|
||||
Reference in New Issue
Block a user