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

Add method call for testing RD class substitution #1032

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Ao-senXiong
Copy link
Member

No description provided.

Copy link
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@@ -5073,9 +5074,18 @@ public boolean isValidUse(
AnnotationMirrorSet tops = qualHierarchy.getTopAnnotations();
TypeMirror declarationTM = declarationType.getUnderlyingType();
AnnotationMirrorSet upperBounds = atypeFactory.getTypeDeclarationBounds(declarationTM);
AbstractViewpointAdapter vpa =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The visitor should not adapt types. I think we should change atypeFactory.getTypeDeclarationBounds to take what it needs to determine the correct bounds for a particular use.
Then the factory that has a viewpoint adaptor can add the adaptation logic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, let me try to move the adaptation over.

@@ -2,15 +2,14 @@
// https://github.com/eisop/checker-framework/issues/777
import viewpointtest.quals.*;

public class VarargsConstructor {

@ReceiverDependentQual public class VarargsConstructor {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be two variants of the test? Why is it enough to add RDQ here? Some comments would be helpful to understand these tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think right now viewpoint test checker has a lot suppress warnings and errors because of we default everything to Top. Since we also forbid Top object creation, I would like to make viewpoint test checker more PICO like system, i.e. default Object to RDQ and make A as the default qualifier.

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.

2 participants