Details
-
Type:
Sub-task
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.5.4
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
The following script:
class Test {
void setProperty(String name, value) {
println "instanceSetProperty"
}
void myMeth() {
println 'instanceMyMeth'
}
}
Test.metaClass.setProperty = { String name, value ->
println 'metaSetProperty'
}
Test.metaClass.myMeth = { ->
println 'metaMyMeth'
}
Test test = new Test()
test.a = 'b'
test.myMeth()
yields:
instanceSetProperty
metaMyMeth
The setProperty method added via the metaclass is ignored.
Issue Links
- depends upon
-
GROOVY-2503
MOP 2.0 design inflluencing issues
-
I changed the fix version to 2.0 because 2.0 is thought to implement a MOP redesign and as long as this does not happen it is unlikely that we will find a good work around for this. It is a limitation of the current design