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

Pascal Schumacher commented on GROOVY-6800:
-------------------------------------------

Thanks for looking into this John. All static compiler / static type checking 
issues are assigned to Cédric when created, but that does mean he is currently 
working on them. Feel free to close issues that are not relevant anymore, even 
if they are assigned to somebody. It the assignee feels that the should not be 
closed he can always reopen the issue later on.

> Compilation error when calling method that has Optional<Closure> parameter
> --------------------------------------------------------------------------
>
>                 Key: GROOVY-6800
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6800
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 2.3.0, 2.4.0-rc-1
>            Reporter: Rob Fletcher
>            Assignee: Cédric Champeau
>         Attachments: FailingWithClosure.groovy, 
> WorkingWithClosureAndCast.groovy, WorkingWithString.groovy
>
>
> I'm seeing a strange issue where if I try to call a method with an 
> {{Optional<Closure>}} parameter from a type-checked context using 
> {{Optional.of(someClosure)}} I get a compilation error. Other type parameters 
> work fine in the same context and weirdly so does {{Optional.absent()}}.
> I've attached 3 scripts that demonstrate the problem.
> * _FailingWithClosure.groovy_ shows the problem occurring. I have a method 
> that accepts {{Optional<Closure>}} and two statically compiled methods that 
> call it, one with {{Optional.of(someClosure)}} and one with 
> {{Optional.absent()}}.
> * _WorkingWithString.groovy_ is the same code but with {{String}} type 
> parameters instead of {{Closure}}. It works fine.
> * _WorkingWithClosureAndCast.groovy_ shows that if I explicitly cast the 
> argument to {{Optional<Closure>}} it works.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to