You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/06/19 13:17:00 UTC
[jira] [Updated] (GROOVY-10660) STC: infer closure/lambda parameter types for return expression
[ https://issues.apache.org/jira/browse/GROOVY-10660?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-10660:
---------------------------------
Description:
Consider the following:
{code:groovy}
@groovy.transform.TypeChecked
def BiConsumer<String, List<?>> m() {
return (text, list) -> {
// ...
}
}
{code}
The types of "text" and "list" are not known and errors occur for String or List method calls.
was:
Consider the following:
{code:groovy}
@groovy.transform.TypeChecked
def <T> BiConsumer<String, List<T>> m() {
return (text, list) -> {
// ...
}
}
{code}
The types of "text" and "list" are not known and errors occur for String or List method calls.
> STC: infer closure/lambda parameter types for return expression
> ---------------------------------------------------------------
>
> Key: GROOVY-10660
> URL: https://issues.apache.org/jira/browse/GROOVY-10660
> Project: Groovy
> Issue Type: Improvement
> Components: Static Type Checker
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
>
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> def BiConsumer<String, List<?>> m() {
> return (text, list) -> {
> // ...
> }
> }
> {code}
> The types of "text" and "list" are not known and errors occur for String or List method calls.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)