I\'ve added a method to Closure\'s metaClass, but I don\'t seem to be able to get a reference for the instance the method is being called on. In th
Closure
metaClass
The problem is that Closure.metaclass and { -> }.metaClass are the different instances.
Closure.metaclass
{ -> }.metaClass
println (Closure.metaClass) println ({ -> }.metaClass)
yields:
org.codehaus.groovy.runtime.HandleMetaClass@12f5f0d org.codehaus.groovy.runtime.metaclass.ClosureMetaClass@192d8d6