Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.0
-
Fix Version/s: 1.8.1
-
Component/s: primtive opts
-
Labels:None
-
Number of attachments :
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.
Oddly, works as expected on the Groovy Web Console (which I believe is running 1.8.0?)...