Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix type inferencing for class reference to non-static method #1527

Closed
eric-milles opened this issue Jan 1, 2024 · 1 comment
Closed

Fix type inferencing for class reference to non-static method #1527

eric-milles opened this issue Jan 1, 2024 · 1 comment
Assignees
Milestone

Comments

@eric-milles
Copy link
Member

eric-milles commented Jan 1, 2024

Consider the following:

void test(Map<String, String> map) {
  def eSet = map.entrySet()
  def eStr = eSet.stream()
  def kStr = eStr.map(Map.Entry::getKey)
  def kSet = kStr.toSet()
}

The inferred type of "kStr" is Stream<Object> where Stream<String> is expected.

image

see GROOVY-11259

@eric-milles eric-milles self-assigned this Jan 1, 2024
@eric-milles eric-milles added this to the v5.3.0 milestone Jan 1, 2024
eric-milles added a commit that referenced this issue Jan 1, 2024
@eric-milles
Copy link
Member Author

image

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant