[
https://issues.apache.org/jira/browse/GROOVY-11201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-11201.
----------------------------------
Fix Version/s: 4.0.16
Resolution: Fixed
https://github.com/apache/groovy/commit/fd952456e33aa3cdd90393af8eebe57815fa6575
> 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
> Fix For: 4.0.16
>
>
> 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)