-
Notifications
You must be signed in to change notification settings - Fork 360
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
The primary annotation on an intersection type is the GLB of the prim… #928
Conversation
…ary annotations of the bounds.
Looks good to me. |
* The primary annotation on an intersection type is the GLB of the primary annotations | ||
* of the bounds. | ||
* <p> | ||
* Example (java) subtyping relationship:<br> |
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.
What is the (java)
comment for?
@@ -2081,6 +2082,14 @@ public AnnotatedTypeMirror getErased() { | |||
} | |||
} | |||
|
|||
/** | |||
* The primary annotation on an intersection type is the GLB of the primary annotations | |||
* of the bounds. |
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 say that there is no syntax to explicitly write the primary annotations in source code.
@@ -2101,6 +2110,36 @@ private AnnotatedIntersectionType( | |||
} | |||
|
|||
@Override | |||
public Set<AnnotationMirror> getAnnotations() { | |||
Set<AnnotationMirror> glbs = null; |
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.
What is the relationship between the value of the annotations
field and the result of this method?
So far, the two were interchangeable. I'm a bit fearful of removing the final
on the parent method and allowing such overrides. You changed one use of annotations
to the method call. Are there others that should be changed?
Status update: I'm still considering how to address Werner's feedback. (Specifically #928 (comment)) |
The primary annotation on an intersection type is the GLB of the primary annotations of the bounds (a.k.a direct super types). Calling addAnnotation on an annotated intersection type adds that annotation to any bound that does not have an annotation in that hierarchy. (Tested on daikon-typecheck)
(More clean up of intersections is required in the rest of the code, but this must wait until LUB(#643) is corrected.)
Fixes #868