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 2022/02/03 22:36:00 UTC

[jira] [Closed] (GROOVY-6603) Static type checks for closure parameters of methods

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

Paul King closed GROOVY-6603.
-----------------------------

> Static type checks for closure parameters of methods
> ----------------------------------------------------
>
>                 Key: GROOVY-6603
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6603
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Static Type Checker
>    Affects Versions: 2.3.0-beta-1
>            Reporter: Maxim Medvedev
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0
>
>
> Static type checker should check calls to closure parameters with provided @ClosureParams information:
> {code}
> @CompileStatic
> void foo(@ClosureParams(value = FromString, options = "java.lang.Number") 
>          Closure cl) { 
>     cl("a") //Compilation should fail here
> }
> {code}
> Of course, these checks are not applicable to reassigned parameters, but in most cases closure parameters are not reassigned.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)