I make a brand new grails project and put this in the bootstrap:
ExpandoMetaClass.enableGlobally()
Integer.metaClass.precision = {->return 1}
println 3.precision()
println "rofl"
println 15.precision()
And it does what I expect, run-app prints:
1
rofl
1
But if i take out the println "rofl"
it won't print that second one. It just prints one 1 without the rofl... WTF?
Again, becasue this doesn't make any sense to me, this code:
ExpandoMetaClass.enableGlobally()
Integer.metaClass.precision = {->return 1}
println 3.precision()
//println "rofl"
println 15.precision()
prints:
1