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

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

Closed
eric-milles opened this issue Jun 19, 2022 · 1 comment
Closed
Assignees
Milestone

Comments

@eric-milles
Copy link
Member

eric-milles commented Jun 19, 2022

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

@eric-milles
Copy link
Member Author

image

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

No branches or pull requests

1 participant