Skip to content

fix: treat upper and lower wildcard bounds as unequal - #6884

Open
kalayciburak wants to merge 2 commits into
INRIA:masterfrom
kalayciburak:fix/wildcard-equals-is-upper
Open

fix: treat upper and lower wildcard bounds as unequal#6884
kalayciburak wants to merge 2 commits into
INRIA:masterfrom
kalayciburak:fix/wildcard-equals-is-upper

Conversation

@kalayciburak

Copy link
Copy Markdown

Summary

CtWildcardReference.equals ignored isUpper, so ? super T and ? extends T compared equal when they shared a bounding type.

EqualsChecker now compares isUpper like other boolean metamodel fields.

fix #6883

Test plan

  • mvn -Dtest=EqualTest#testEqualsWildcardRespectsUpperBound test (RED before the checker change, GREEN after)
  • mvn -Dtest=EqualTest,AssignmentsEqualsTest,GenericsTest#testWildcard,TypeReferenceTest#testClearBoundsForWildcardReference test
  • mvn spotless:check checkstyle:check

EqualsChecker compared wildcard bounding types but ignored
isUpper, so ? super T and ? extends T compared equal.

fix INRIA#6883
@MartinWitt

Copy link
Copy Markdown
Collaborator

@kalayciburak can u fix the javadoc please?

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.

[Bug]: CtWildcardReference::equals does not respect isUpper

2 participants