[
https://issues.apache.org/jira/browse/GROOVY-8187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jasmin Patel updated GROOVY-8187:
---------------------------------
Attachment: Test.groovy
> Closure MissingPropertyException
> --------------------------------
>
> Key: GROOVY-8187
> URL: https://issues.apache.org/jira/browse/GROOVY-8187
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.11
> Environment: Distributor ID: Ubuntu
> Description: Ubuntu 16.04.2 LTS
> Release: 16.04
> Codename: xenial
> Groovy Version: 2.4.11 JVM: 1.8.0_121 Vendor: Oracle Corporation OS: Linux
> Reporter: Jasmin Patel
> Priority: Minor
> Attachments: Test.groovy
>
>
> {code:none}
> return (1..1000)
> .any(
> {
> final it ->
> it % 2000 == 2000
> })
> {code}
> {code:none}
> println(
> (1..1000)
> .any
> {
> final it ->
> it % 2000 ==
> 2000
> }
> )
> {code}
> {code:none}
> return (1..1000)
> .any
> {
> final it ->
> it % 2000 == 2000
> }
> {code}
> First snippet works, so does second. Third one causes the following exception:
> groovy.lang.MissingPropertyException: Exception evaluating property 'any' for
> groovy.lang.IntRange, Reason: groovy.lang.MissingPropertyException: No such
> property: any for class: java.lang.Integer
> More cases in attachment.
> If a fix is not desirable then can we at least get a more helpful error?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)