-
Notifications
You must be signed in to change notification settings - Fork 19
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 lost qualifier to viewpointtest type checker #827
base: master
Are you sure you want to change the base?
Conversation
TODO: lost is not reflexive |
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.
Thanks!
framework/src/test/java/viewpointtest/ViewpointTestQualifierHierarchy.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Werner Dietl <[email protected]>
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.
Thanks for the fixes and the extensive tests!
@@ -2,6 +2,7 @@ | |||
receiver.invalid=incompatible types.%nfound : %s%nrequired: %s | |||
type.anno.before.modifier=write type annotation %s immediately before type, after modifiers %s | |||
type.anno.before.decl.anno=write type annotations %s immediately before type, after declaration annotation %s | |||
new.class.type.invalid=the annotations %s do not need be applied in object creations |
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.
Can you move this further down to other type.invalid
error messages.
While we're at it, can you improve the grammar?
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.
Done!
framework/src/test/java/viewpointtest/ViewpointTestAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
framework/src/test/java/viewpointtest/ViewpointTestViewpointAdapter.java
Outdated
Show resolved
Hide resolved
framework/src/test/java/viewpointtest/ViewpointTestVisitor.java
Outdated
Show resolved
Hide resolved
@PolyVP MyClass(@PolyVP Object o) { | ||
throw new RuntimeException(" * You are filled with DETERMINATION."); // stub | ||
// :: warning: (cast.unsafe.constructor.invocation) | ||
throw new @A RuntimeException(" * You are filled with DETERMINATION."); // stub |
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's the point of this change? Should there be multiple versions?
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.
I expand the test suite in here.
VarargsConstructor a = new VarargsConstructor("testStr", new Object()); | ||
VarargsConstructor a = | ||
// :: warning: (cast.unsafe.constructor.invocation) | ||
new @A VarargsConstructor("testStr", new @A Object()); |
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.
Is this change illustrating something about Lost
? Should there be versions of this test without an annotation? A comment would help understand this test.
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.
This change is not about lost, I update this test case because I want those invalid invocation because previous we allow @Top
constructor invocation. More test cases for lost is in LostNonReflexive.java
framework/src/test/java/viewpointtest/ViewpointTestQualifierHierarchy.java
Outdated
Show resolved
Hide resolved
@Override | ||
public Void visitNewClass(NewClassTree tree, Void p) { | ||
AnnotatedTypeMirror Type = atypeFactory.getAnnotatedType(tree); | ||
if (Type.hasAnnotation(atypeFactory.TOP)) { |
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.
Shouldn't LOST
also be forbidden?
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.
Yes, how about poly
and RD
qualifier? I left out those two as I feel like we need more discussion.
Co-authored-by: Werner Dietl <[email protected]>
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.
Thanks!
Fixes #576