Skip to content

Commit

Permalink
annotation call resolver: lookup scope before creating one
Browse files Browse the repository at this point in the history
  • Loading branch information
neetopia committed Nov 15, 2023
1 parent 18ab23b commit 1bf0b8c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,10 @@ fun LazyAnnotationDescriptor.getValueArguments(): Map<Name, ConstantValue<*>> {
override fun toString(): String = "${name.asString()} declared in LazyAnnotations.kt"
}

val scope = (c.scope.ownerDescriptor as? PackageFragmentDescriptor)?.let {
LexicalScope.Base(c.scope, FileDescriptorForVisibilityChecks(source, it))
} ?: c.scope
val scope = c.trace.get(BindingContext.LEXICAL_SCOPE, annotationEntry)
?: (c.scope.ownerDescriptor as? PackageFragmentDescriptor)?.let {
LexicalScope.Base(c.scope, FileDescriptorForVisibilityChecks(source, it))
} ?: c.scope

val resolutionResults = c.annotationResolver.resolveAnnotationCall(annotationEntry, scope, c.trace)
AnnotationResolverImpl.checkAnnotationType(annotationEntry, c.trace, resolutionResults)
Expand Down

0 comments on commit 1bf0b8c

Please sign in to comment.