[FIR] fix resolve contract violation from scopes
We cannot call lazy resolve to STATUS phase from scopes as scopes may be accessed on a STATUS phase or earlier ^KT-54890 ^KTIJ-23587 fixed
This commit is contained in:
+2
-2
@@ -151,7 +151,7 @@ class FirElementSerializer private constructor(
|
||||
}
|
||||
|
||||
fun FirClass.nestedClassifiers(): List<FirClassifierSymbol<*>> {
|
||||
val scope = defaultType().scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing) ?: return emptyList()
|
||||
val scope = defaultType().scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = null) ?: return emptyList()
|
||||
return buildList {
|
||||
scope.getClassifierNames().mapNotNullTo(this) { scope.getSingleClassifier(it) }
|
||||
}
|
||||
@@ -226,7 +226,7 @@ class FirElementSerializer private constructor(
|
||||
|
||||
private fun FirClass.declarations(): List<FirCallableDeclaration> = buildList {
|
||||
val memberScope =
|
||||
defaultType().scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing)
|
||||
defaultType().scope(session, scopeSession, FakeOverrideTypeCalculator.DoNothing, requiredPhase = null)
|
||||
?: error("Null scope for $this")
|
||||
|
||||
fun addDeclarationIfNeeded(symbol: FirCallableSymbol<*>) {
|
||||
|
||||
Reference in New Issue
Block a user