[FIR] Add comment for keeping the two places where class scopes are build in sync.

This commit is contained in:
Kirill Rakhman
2023-12-13 14:40:52 +01:00
committed by Space Team
parent d574d859cb
commit b7bdbd270f
2 changed files with 10 additions and 0 deletions
@@ -461,6 +461,11 @@ open class FirTypeResolveTransformer(
fun removeOuterTypeParameterScope(firClass: FirClass): Boolean = !firClass.isInner && !firClass.isLocal
/**
* Changes to the order of scopes should also be reflected in
* [org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.BodyResolveContext.withScopesForClass].
* Otherwise, we get different behavior between type resolve and body resolve phases.
*/
inline fun <R> withClassScopes(
firClass: FirClass,
crossinline actionInsideStaticScope: () -> Unit = {},
@@ -440,6 +440,11 @@ class BodyResolveContext(
}
}
/**
* Changes to the order of scopes should also be reflected in
* [org.jetbrains.kotlin.fir.resolve.transformers.FirTypeResolveTransformer.withClassScopes].
* Otherwise, we get different behavior between type resolve and body resolve phases.
*/
fun <T> withScopesForClass(
owner: FirClass,
holder: SessionHolder,