[FIR] Change some phase requirements: STATUS -> DECLARATIONS

NB: Also not quite sure this is better. IMO this shows more clearly that
we require results of declarations resolve and not some strange 'STATUS'
This commit is contained in:
Mikhail Glukhikh
2020-10-09 16:03:56 +03:00
committed by Dmitriy Novozhilov
parent 275260720d
commit 0b8116dff0
4 changed files with 5 additions and 5 deletions
@@ -187,7 +187,7 @@ object FirExposedVisibilityDeclarationChecker : FirMemberDeclarationChecker() {
): FirMemberDeclaration? {
val type = this as? ConeClassLikeType ?: return null
val fir = type.fullyExpandedType(context.session).lookupTag.toSymbol(context.session)?.let { firSymbol ->
firSymbol.ensureResolved(FirResolvePhase.STATUS, context.session)
firSymbol.ensureResolved(FirResolvePhase.DECLARATIONS, context.session)
firSymbol.fir
} ?: return null
@@ -125,7 +125,7 @@ fun BodyResolveComponents.typeForQualifier(resolvedQualifier: FirResolvedQualifi
val classSymbol = resolvedQualifier.symbol
val resultType = resolvedQualifier.resultType
if (classSymbol != null) {
classSymbol.ensureResolved(FirResolvePhase.STATUS, session)
classSymbol.ensureResolved(FirResolvePhase.DECLARATIONS, session)
val declaration = classSymbol.fir
if (declaration !is FirTypeAlias || resolvedQualifier.typeArguments.isEmpty()) {
typeForQualifierByDeclaration(declaration, resultType, session)?.let { return it }
@@ -29,7 +29,7 @@ fun ConeKotlinType.scope(
scopeSession: ScopeSession,
fakeOverrideTypeCalculator: FakeOverrideTypeCalculator
): FirTypeScope? {
val scope = scope(useSiteSession, scopeSession, FirResolvePhase.STATUS) ?: return null
val scope = scope(useSiteSession, scopeSession, FirResolvePhase.DECLARATIONS) ?: return null
if (fakeOverrideTypeCalculator == FakeOverrideTypeCalculator.DoNothing) return scope
return FirScopeWithFakeOverrideTypeCalculator(scope, fakeOverrideTypeCalculator)
}
@@ -59,8 +59,8 @@ fun ConeKotlinType.ensureResolvedTypeDeclaration(
) {
if (this !is ConeClassLikeType) return
lookupTag.toSymbol(useSiteSession)?.ensureResolved(FirResolvePhase.STATUS, useSiteSession)
fullyExpandedType(useSiteSession).lookupTag.toSymbol(useSiteSession)?.ensureResolved(FirResolvePhase.STATUS, useSiteSession)
lookupTag.toSymbol(useSiteSession)?.ensureResolved(FirResolvePhase.DECLARATIONS, useSiteSession)
fullyExpandedType(useSiteSession).lookupTag.toSymbol(useSiteSession)?.ensureResolved(FirResolvePhase.DECLARATIONS, useSiteSession)
}
fun FirTypeRef.ensureResolvedTypeDeclaration(