Hi,
So I run into a gotcha today:
​import groovy.transform.CompileStatic@CompileStaticclass 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: 
http://groovy.329449.n5.nabble.com/Bug-with-closure-and-compile-static-tp5736592.html
Sent from the Groovy Users mailing list archive at Nabble.com.

Reply via email to