groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krzysztof Kowalczyk <kowalczyk.krzysz...@gmail.com>
Subject Re: Bug with closure() and compile static ?
Date Wed, 09 Nov 2016 20:10:20 GMT
done: https://issues.apache.org/jira/browse/GROOVY-7995

On 9 November 2016 at 18:46, Jochen Theodorou <blackdrag@gmx.org> wrote:

> absolutely a bug, please fill a ticket for it
>
> On 09.11.2016 13:20, Krzysztof Kowalczyk wrote:
>
>> Hi,
>> So I run into a gotcha today:
>>
>> ‚Äčimport groovy.transform.CompileStatic
>>
>> @CompileStatic
>> class Foo {
>>      Closure c = { println "right closure" }
>>      Closure wrap = {
>>          println "wrapping closure"
>>          c() // stack overflow invoke wrap() instead of c()
>>      }
>>
>>      def run(){
>>          wrap()
>>      }
>> }
>>
>> new Foo().run()‚Äč
>>
>> So this example throws stack overflow exception if CompileStatic is used.
>> It would run correctly with c.call() or without CompileStatic.
>>
>> Bug? Did found some things with stack overflow in Jira but nothing that
>> looked the same.
>>
>> Regards,
>> Krzysztof
>> ------------------------------------------------------------------------
>> View this message in context: Bug with closure() and compile static ?
>> <http://groovy.329449.n5.nabble.com/Bug-with-closure-and-
>> compile-static-tp5736592.html>
>> Sent from the Groovy Users mailing list archive
>> <http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html> at
>> Nabble.com.
>>
>
>

Mime
View raw message