groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krzysztof Kowalczyk <>
Subject Bug with closure() and compile static ?
Date Wed, 09 Nov 2016 12:20:43 GMT
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 or without CompileStatic.

Bug? Did found some things with stack overflow in Jira but nothing that
looked the same.


View this message in context:
Sent from the Groovy Users mailing list archive at
View raw message