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

GROOVY-8084, GROOVY-9074, GROOVY-10588: STC: wildcard capture checks #2121

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

eric-milles
Copy link
Member

@eric-milles eric-milles commented Nov 11, 2024

When comparing method call arguments to parameters, wildcard generics are considered captured. Thus, they are not compatible with other types. https://docs.oracle.com/javase/tutorial/extra/generics/wildcards.html

TODO: The test case for GROOVY-10006 / GROOVY-10339 produces a wildcard for LowestUpperBoundClassNode and so it fails

  def <T> void test(T x, T y, T z) { }
  test(1,"II",Class) // Cannot call <T> test(T, T, T) with arguments [int, String, Class]

@eric-milles eric-milles marked this pull request as ready for review November 13, 2024 13:35
@eric-milles eric-milles merged commit 71490fb into master Nov 13, 2024
37 checks passed
@eric-milles eric-milles deleted the GROOVY-9074 branch November 13, 2024 13:36
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