Skip to content

Fix for assignment check with type vars and OaM #124

Open
WolframPfeifer wants to merge 4 commits intoopprop:masterfrom
WolframPfeifer:oamAssignmentTypeVarFix
Open

Fix for assignment check with type vars and OaM #124
WolframPfeifer wants to merge 4 commits intoopprop:masterfrom
WolframPfeifer:oamAssignmentTypeVarFix

Conversation

@WolframPfeifer
Copy link
Copy Markdown

@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