Jasmin Patel created GROOVY-8187:
------------------------------------
Summary: 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:groovyl}
return (1..1000)
.any(
{
final it ->
it % 2000 == 2000
})
{code}
{code:groovyl}
println(
(1..1000)
.any
{
final it ->
it % 2000 ==
2000
}
)
{code}
{code:groovyl}
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
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)