Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.0-rc-3
-
None
-
None
Description
This code:
@Newify([String]) String test1() { return String("ABC") } @Newify([String]) String test2() { return { -> String("ABC") }.call() } assert "ABC"==test1() assert "ABC"==test2()
results in:
Caught: groovy.lang.MissingMethodException: No signature of method: x.String() is applicable for argument types: (java.lang.String) values: [ABC]
Possible solutions: toString(), toString(), print(java.lang.Object), print(java.lang.Object), print(java.io.PrintWriter), run()
groovy.lang.MissingMethodException: No signature of method: x.String() is applicable for argument types: (java.lang.String) values: [ABC]
Possible solutions: toString(), toString(), print(java.lang.Object), print(java.lang.Object), print(java.io.PrintWriter), run()
at x$_test2_closure1.doCall(x.groovy:9)
at x.test2(x.groovy:9)
at x$test2$0.callCurrent(Unknown Source)
at x.run(x.groovy:13)
I expect this test2 works as well as test1.
Attachments
Issue Links
- relates to
-
GROOVY-10713 ClassCodeExpressionTransformer ignoring Expressions within ClosureExpression.code
- Closed