Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.5.4
-
None
-
None
-
None
-
linux
-
Patch
Description
This is best shown by a small example. I've attached a trivial patch as well.
class A {
String toString()
}
A.metaClass.toString = { ->
"changed";
}
def a = new A();
println a.toString();
println "${a}";
brandon@Brandon:~/localtmp/groovy-1.5.4$ unset GROOVY_HOME
brandon@Brandon:~/localtmp/groovy-1.5.4$ groovy-unpatched test.groovy
changed
unchanged
brandon@Brandon:~/localtmp/groovy-1.5.4$ groovy test.groovy
changed
changed
Attachments
Attachments
Issue Links
- duplicates
-
GROOVY-2599 unable to overwrite toString() via MOP in some cases
- Open