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

Fix for assignment check with type vars and OaM #124

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

Conversation

WolframPfeifer
Copy link

@WolframPfeifer WolframPfeifer commented Dec 18, 2024

This PR fixes a bug in the assignment check, where fields of an @Any object could be assigned even though -Alint=checkOaM was activated. The cause was a missing use of effective annotations.

Minimal example where the bug occurs (I can add a test case if desired):

class IntCell {
  int f;
}

class L<T extends @Any IntCell> {
  void m(T x) {
    x.f = 5;  // should not be allowed with OaM, but the checker does not complain
  }
}

Note:

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.

1 participant