Skip to content

Fix type inferencing for closure/lambda parameters of return expression #1373

@eric-milles

Description

@eric-milles

Consider the following:

import java.util.function.BiConsumer

def <T> BiConsumer<String, List<T>> m(BiConsumer<String, ? super T> consumer) {
  return { text, list -> // or (text, list) -> {
    for (item in list) {
      consumer.accept(text, item)
    }
  }
}

The types of "text", "list" and "item" are all unknown (Object). Code assist for any of these variables is limited.

See also GROOVY-10660

Derived from #1327

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions