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 2020/09/20 00:56:00 UTC

[jira] [Resolved] (GROOVY-9735) STC: incorrect error for actual vs inferred closure parameter type

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

Paul King resolved GROOVY-9735.
-------------------------------
    Fix Version/s: 3.0.6
                   4.0.0-alpha-1
       Resolution: Fixed

> STC: incorrect error for actual vs inferred closure parameter type
> ------------------------------------------------------------------
>
>                 Key: GROOVY-9735
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9735
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-alpha-1, 3.0.6
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Follow up from GROOVY-9570.  When the method is not a DGM, there is a slightly different path through STC and the same error is currently given.
> {code:groovy}
> import groovy.transform.stc.*
> @groovy.transform.TypeChecked
> class C<I extends Item> {
>   Queue<I> queue
>   def c = { ->
>     x(queue) { I item ->
>       println item
>     }
>   }
>   def m() {
>     x(queue) { I item ->
>       println item
>     }
>   }
>   def <T> T x(Collection<T> y, @ClosureParams(FirstParam.FirstGenericType) Closure<?> z) {
>   }
> }
> interface Item {}
> new C()
> {code}
> Both instances of "I item" are flagged with the same error described in GROOVY-9570



--
This message was sent by Atlassian Jira
(v8.3.4#803005)