Description
Consider the following:
trait Foo { void bar() { print this } } "xxx".withTraits(Foo).bar() // prints String1_groovyProxy@328cf0e1
class Foo { String toString() { "foo" } } trait Bar { String getBaz() { this.toString() } } print(new Foo().withTraits(Bar).baz) // prints Foo2_groovyProxy@14b030a0
In the first example, I need to call a String method like "this.toLowerCase()" instead of "this" for it to work. I tried "this.toStirng()" but that fails as well, as illustrated in the second example.