You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/12/27 19:48:00 UTC
[jira] [Resolved] (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 ]
Eric Milles resolved GROOVY-6603.
---------------------------------
Resolution: Fixed
https://github.com/apache/groovy/commit/71b4c77f02a548ba7ee0b8cac9e92b711ac5faad
> 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
>
> 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)