[ 
https://issues.apache.org/jira/browse/GROOVY-11085?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King closed GROOVY-11085.
------------------------------

> STC: assignment of closure with untyped parameter to SAM-type (setter target)
> -----------------------------------------------------------------------------
>
>                 Key: GROOVY-11085
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11085
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 3.0.17
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 3.0.18
>
>
> Consider the following:
> {code:groovy}
> void setStrategy(Predicate<Long> tester) {
>   assert tester.test(1L)
> }
> strategy = { n -> n instanceof Long }
> {code}
> Compiler error: "Incompatible generic argument types. Cannot assign 
> Predicate<Object> to Predicate<Long>"



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to