You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2023/08/23 09:10:00 UTC

[jira] [Closed] (GROOVY-11085) STC: assignment of closure with untyped parameter to SAM-type (setter target)

     [ 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)