diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveContext.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveContext.kt index 6ffb5c546018b..5e6951c8c5f67 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveContext.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveContext.kt @@ -449,7 +449,10 @@ class BodyResolveContext( val typeParameterScope = (owner as? FirRegularClass)?.typeParameterScope() val selfTypeScope: FirSelfTypeScope? = - owner.annotations.find { it.classId == StandardClassIds.Annotations.Self }?.let { FirSelfTypeScope(owner) } + if (owner.hasAnnotation(StandardClassIds.Annotations.Self)) { + FirSelfTypeScope(owner) + } else + null val forMembersResolution = staticsAndCompanion