groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Harvey <nathanwhar...@gmail.com>
Subject G-String embedded Closure calling bug?
Date Thu, 21 Dec 2017 22:20:44 GMT
Take the following code:

int triggered = 0
def o = { -> triggered++ }
		
println(o) // A
println("$o") // B
println("${o}") // C

After A, triggered is 0; after B, it's 1; after C, it's 2. The Closure is
being called and the result of it is being printed instead. Is this behavior
intended?



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Mime
View raw message