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 checked default for inference annotated type factory #53

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

Conversation

d367wang
Copy link
Contributor

@d367wang d367wang commented Aug 31, 2021

Related to opprop/checker-framework-inference#341

This is a workaround for the following corner case:

class Demo {

    void foo() {
        new Comparator() {
            public int compare(Object o1, Object o2) {
                return 1;
            }
        };
    }
}

Here a raw type interface is used to create anonymous class. The type argument of Comparator is substituted to wildcard.
Currently defaults are applied to the wildcard upper/lower bound.

We need to specify the default for TypeUseLocation.OTHERWISE or TypeUseLocation.ALL, so that the wildcard type argument won't miss annotations.

@d367wang d367wang changed the title Add default qualifier for real type factory Add checked default for inference annotated type factory Sep 1, 2021
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