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

Jochen Theodorou commented on GROOVY-6324:
------------------------------------------

[~emilles] For a local variable we add information if we assign a closure to 
it. Then we can use that information to determine if the call using that 
variable is valid or not. But here it is a field, maybe even a precompiled 
class in Java. There is no assignment we can trace. Where to get the meta 
information we require? I think for this to compile a annotation like we use it 
for DGM would be required. Not sure if the same annotation could be used or 
should be used.

> Cannot call closure like a method in type checked mode
> ------------------------------------------------------
>
>                 Key: GROOVY-6324
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6324
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 2.2.0-beta-1, 2.3.0, 2.4.0-rc-1
>            Reporter: Peter Niederwieser
>            Priority: Major
>
> {{Closure closure = ...; closure()}} doesn't work in type-checked mode. 
> Instead, one has to use {{closure.call()}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to