Skip to content

Commit

Permalink
annotation call resolver: lookup scope before creating one
Browse files Browse the repository at this point in the history
(cherry picked from commit 1bf0b8c)
  • Loading branch information
neetopia authored and KSP Auto Pick committed Nov 16, 2023
1 parent fcf67b3 commit de324d6
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 de324d6

Please sign in to comment.