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

Correct type.invalid.super.wildcard message #283

Merged
merged 2 commits into from
Jul 12, 2022

Conversation

zcai1
Copy link
Collaborator

@zcai1 zcai1 commented Jul 11, 2022

The arguments passed to type.invalid.super.wildcard were not in the right order, so this PR fixes it.

The behavior of this check should be valid as described in: typetools#5006

We encountered a warning in:

import java.util.Set;
import org.checkerframework.checker.nullness.qual.*;

public class TestSet {
    void foo(Set<Object> s1, Set<? super Object> s2) {
        s1.retainAll(s2);
    }
}

because the capture of Set<? super Object> is Set<Object> and its implicit upper bound is @Nullable.

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!

@wmdietl wmdietl merged commit 5a8369a into eisop:master Jul 12, 2022
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