Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.9, 2.1.2
-
None
Description
The following code:
def map = [:].withDefault { 'foo' } Map.metaClass.bar = { -> 'ok' } assert map.bar() == 'ok' assert !map.containsKey('bar') println map.keySet()
Fails at the second assertion, because MetaClassImpl triggers an unexpected get() into the map.
Note that the behaviour is not the same if you use a per instance MC, which probably means inconsistencies...