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

Upstreaming: Defaulting for bounds of unbounded wildcards #2

Open
cpovirk opened this issue Oct 19, 2020 · 2 comments
Open

Upstreaming: Defaulting for bounds of unbounded wildcards #2

cpovirk opened this issue Oct 19, 2020 · 2 comments

Comments

@cpovirk
Copy link
Collaborator

cpovirk commented Oct 19, 2020

c24904e

At first glance, this looks straightforward (though it should come with a test). However, note that we change the value of boundType: Previously, it would match the type parameter's bound type (UPPER or UNBOUNDED, as the case may be). But in our commit, it is always UNBOUNDED. This may change behavior of existing code.

One possibility is to track "wildcard-site unboundedness" as a separate bit, used only to trigger our new UNBOUNDED_WILDCARD_UPPER_BOUND, while leaving boundType untouched to preserve existing behavior.

Usage: jspecify/jspecify-reference-checker@94bf778#diff-ce82a59b06d0d82bfc6d06835d1b06ac15619bc3a71617d32189d041f02ca9c0R541

(The only way I found to set this default was to modify the Checker Framework itself. In particular, I wasn't able to employ an approach like I did in jspecify/jspecify-reference-checker@8e46bea#diff-ce82a59b06d0d82bfc6d06835d1b06ac15619bc3a71617d32189d041f02ca9c0R288: IIUC, that code jumps between usages and declarations, so it can't track whether the wildcard itself appears in null-aware or non-null-aware code. Thus, it can't apply different defaults for the two cases.)

@cpovirk
Copy link
Collaborator Author

cpovirk commented Nov 23, 2020

I further revised that commit in d469162.

@cpovirk
Copy link
Collaborator Author

cpovirk commented Feb 25, 2021

Also touched by 0903643, but that change would not be necessary if we upstreamed the rest.

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

No branches or pull requests

1 participant