Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.5
-
None
-
None
-
Java 6 on 32 bit MS Vista
Description
The closure arrow for a dynamically added method seems to be necessary, which seems a bit inconsistent with usual closure usage. E.g. this works:
class Book
{ String title }Book.metaClass.toString = { -> title }
def b = new Book(title:"The Stand")
assert "The Stand" == b.toString()
But this doesn't:
class Book { String title }
Book.metaClass.toString =
{ title }def b = new Book(title:"The Stand")
assert "The Stand" == b.toString()