FIR: expect getClassLikeSymbolByFqName to return null for local classes

This commit is contained in:
Mikhail Glukhikh
2019-10-24 13:29:51 +03:00
parent a13ae08b52
commit 1e4f07ebc7
2 changed files with 5 additions and 9 deletions
@@ -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>()
}
@@ -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) {