groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Theodorou (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8187) Closure MissingPropertyException
Date Fri, 12 May 2017 09:07:07 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-8187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16007828#comment-16007828
] 

Jochen Theodorou commented on GROOVY-8187:
------------------------------------------

I would have expected case 2 to fail as well, because I would have expected, that Groovy does
not see this as an attached block

> 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



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message