爲什麼下面的代碼產生StackOverflowException?嵌套的Groovy閉包產生StackOverflowException
Closure c0 = {
println "$this $owner $delegate"
Closure c1 = {
println "$this $owner $delegate"
}
c1()
}
c0()
,輸出是
java.lang.StackOverflowError
at Script1$_run_closure1$_closure2.doCall(Script1.groovy:5)
at Script1$_run_closure1$_closure2.doCall(Script1.groovy)
at Script1$_run_closure1.doCall(Script1.groovy:7)
at Script1$_run_closure1$_closure2.doCall(Script1.groovy:5)
at Script1$_run_closure1$_closure2.doCall(Script1.groovy)
at Script1$_run_closure1.doCall(Script1.groovy:7)
謝謝,我想你回答我的問題 – ntviet18