Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.0
-
None
Description
Having the following code...
class A { String m1() { println 'called m1'; 'm1' } String m2() { println 'called m2'; println m1(); 'm2' } } a = new A() a.metaClass.m1 = { -> println 'pwned m1'; 'o-m1' }
Calling a.m2() shows...
called m2 called m1 m1 ===> m2
...but expected is this:
called m2 pwned m1 o-m1 ===> m2
The correct output is shown in Groovy 1.7.x, only Groovy 1.8.0 shows the wrong one.