-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add type
as part of target location
#972
base: master
Are you sure you want to change the base?
Conversation
Hi @wmdietl, do you know how to update the Line 529 in c29e50b
It is later retrieved at here. Line 1663 in c29e50b
The expected error did not come up because in the |
The root cause should be here as the method Line 318 in 93f44a2
which does not consider bound in |
outer.addAnnotation(t, qual); | ||
atypeFactory.elementCache.put(outer.scope, t); | ||
} else { | ||
// should report error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the annotation supplied is incompatible with the one in DefaultQualifier
, should we report error or we should keep the explicit qualifier? That is to say, in the following code, should we keep @B
or should we report error?
@DefaultQualifier(
value = A.class,
locations = {TypeUseLocation.TYPE})
@B
public class DefaultQualifierTest {
@B DefaultQualifierTest() {}
}
@@ -1010,6 +1010,24 @@ public Void scan(@FindDistinct AnnotatedTypeMirror t, AnnotationMirror qual) { | |||
// Some defaults only apply to the top level type. | |||
boolean isTopLevelType = t == outer.type; | |||
switch (outer.location) { | |||
case TYPE: | |||
if (outer.scope != null && outer.scope.getKind().isClass() && isTopLevelType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, another question is should we apply the class level default only for toplevel? Or nested classes as well?
No description provided.