Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

smillst
Copy link
Member

@smillst smillst commented Sep 29, 2016

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

@mernst
Copy link
Member

mernst commented Sep 29, 2016

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>
Copy link
Member

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.
Copy link
Member

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;
Copy link
Member

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?

@smillst smillst self-assigned this Oct 5, 2016
@smillst
Copy link
Member Author

smillst commented Oct 7, 2016

Status update: I'm still considering how to address Werner's feedback. (Specifically #928 (comment))

@smillst smillst closed this Sep 18, 2017
@mernst mernst deleted the intersections branch October 7, 2017 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants