[
https://issues.apache.org/jira/browse/GROOVY-9132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17230939#comment-17230939
]
Eric Milles commented on GROOVY-9132:
-------------------------------------
This may have been resolved by GROOVY-9803
> Improve type inference for method reference
> -------------------------------------------
>
> Key: GROOVY-9132
> URL: https://issues.apache.org/jira/browse/GROOVY-9132
> Project: Groovy
> Issue Type: Improvement
> Components: Static Type Checker
> Reporter: Paul King
> Priority: Major
>
> Compiling this code:
> {code}
> assert 'Hi'.transform(String::length) * 3 == 6 // transform is JDK12
> {code}
> with type checking gives:
> {noformat}
> [Static type checking] - Cannot find matching method
> java.lang.Object#multiply(int). Please check if the declared type is correct
> and if the method exists.
> {noformat}
> We can close as duplicate if this overlaps with an existing issue. It might
> not be anything to do with method references but an existing limitation in
> the type checker around supporting generics involving bounded parameters. For
> reference, the definition of {{transform}} is:
> {code}
> public <R> R transform​(Function<? super String,​? extends R> f)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)