Skip to content

Add checked default for inference annotated type factory#53

Open
d367wang wants to merge 14 commits intoopprop:masterfrom
d367wang:unsat-verify
Open

Add checked default for inference annotated type factory#53
d367wang wants to merge 14 commits intoopprop:masterfrom
d367wang:unsat-verify

Conversation

@d367wang
Copy link
Copy Markdown
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