Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6.1
-
None
-
None
-
Windows XP, JDK 6 u13
Description
Problem in mapping the method call correctly to one of the statically imported methods.
The case:
In TestFunc.groovy:
package test;
public class TestFunc {
def static func(arg)
{ println arg.getClass(); }}
and in another source (main.groovy):
import static test.TestFunc.*;
def hmap = [ text: 'Text', value: 1 ]
func hmap // this works
func ([text: 'Some text', value: 1]) // also OK
func text: 'Some text', value: 1 // but this throws exception
Output:
class java.util.LinkedHashMap
class java.util.LinkedHashMap
Caught: groovy.lang.MissingMethodException: No signature of method: main.func()
is applicable for argument types: (java.util.LinkedHashMap) values: [[text:Some
text, value:1]]
at main.run(main.groovy:6)