Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The following works
groovy> foo = new Expando()
groovy> foo.class = { println("Called with ${it}") }
groovy> foo.class("hey!")
groovy>
Called with hey!
however the following fails
groovy> foo = new Expando(foo:123, class:'hello')
groovy> foo
groovy>
Caught: org.codehaus.groovy.syntax.parser.UnexpectedTokenException: null:1: <identifier> expected but found "class" 'class'
org.codehaus.groovy.syntax.parser.UnexpectedTokenException: null:1: <identifier> expected but found "class" 'class'
at org.codehaus.groovy.syntax.parser.Parser.consume(Parser.java:1965)
at org.codehaus.groovy.syntax.parser.Parser.rootNode(Parser.java:2069)
at org.codehaus.groovy.syntax.parser.Parser.namedParameterList(Parser.java:1628)
at org.codehaus.groovy.syntax.parser.Parser.parameterList(Parser.java:1599)
at org.codehaus.groovy.syntax.parser.Parser.newExpression(Parser.java:1671)