[
https://issues.apache.org/jira/browse/GROOVY-9997?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-9997:
--------------------------------
Fix Version/s: 2.5.16
> STC: cast or coerce to functional interface fails to infer param types of
> closure/lambda
> ----------------------------------------------------------------------------------------
>
> Key: GROOVY-9997
> URL: https://issues.apache.org/jira/browse/GROOVY-9997
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.0-alpha-3, 3.0.9, 2.5.16
>
>
> Variation of GROOVY-9977. Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> def stc() {
> return (Comparator<Integer>) { a, b -> Integer.compare(a, b) }
> }
> {code}
> When casting or coercing a closure/lambda expression the type checker fails
> to infer the parameter types.
> {{[Static type checking] - Cannot find matching method
> java.lang.Integer#compare(java.lang.Object, java.lang.Object). Please check
> if the declared type is correct and if the method exists.}}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)