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 2023/11/03 18:20:00 UTC
[jira] [Closed] (GROOVY-8036) Compiler throws NPE
[ https://issues.apache.org/jira/browse/GROOVY-8036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles closed GROOVY-8036.
-------------------------------
Resolution: Fixed
Type checker now reports "Incorrect number of parameters. Expected 1 but found 0"
> Compiler throws NPE
> -------------------
>
> Key: GROOVY-8036
> URL: https://issues.apache.org/jira/browse/GROOVY-8036
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 2.4.7
> Reporter: Tommy Svensson
> Assignee: Eric Milles
> Priority: Major
>
> With code like this:
> int a = 5
> [1..a].each { ->
> println "qwerty"
> }
> the compiler throws an NPE. OK, this is incorrect code since it is missing a value before '->', but this should preferably produce an error message and not an NPE :-)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)