Skip to content

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

@eric-milles

Description

@eric-milles

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions