[
https://issues.apache.org/jira/browse/GROOVY-11201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-11201:
---------------------------------
Description:
Consider the following:
{code:groovy}
import java.util.function.Consumer
void setX(String string) { }
Consumer<String> c = this.&setX
{code}
With STC enabled, the compiler states {{Closure<Void>}} cannot be assigned to
{{Consumre<String>}}.
was:
Consider the following:
{code:groovy}
import java.util.function.Consumer
void setX(String) {}
Consumer<String> c = this.&setX
{code}
With STC enabled, the compiler states {{Closure<Void>}} cannot be assigned to
{{Consumre<String>}}.
> STC: assign method pointer to SAM-type
> --------------------------------------
>
> Key: GROOVY-11201
> URL: https://issues.apache.org/jira/browse/GROOVY-11201
> Project: Groovy
> Issue Type: Improvement
> Components: Static Type Checker
> Affects Versions: 3.0.19, 4.0.15
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
>
> Consider the following:
> {code:groovy}
> import java.util.function.Consumer
> void setX(String string) { }
> Consumer<String> c = this.&setX
> {code}
> With STC enabled, the compiler states {{Closure<Void>}} cannot be assigned to
> {{Consumre<String>}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)