Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.8
-
None
Description
When you try to perform the following invocation in a statically checked/compile Groovy class you'll get a compilation error:
myFolder.traverse([ type: FileType.FILES, nameFilter: ~/.*\.(?i)pdf/ ]) { println it }
The error is:
Groovy:[Static type checking] - Cannot call java.io.File#traverse(java.util.Map <java.lang.String, java.lang.Object>, groovy.lang.Closure) with arguments [java.util.LinkedHashMap <java.lang.String, java.io.Serializable>, groovy.lang.Closure]
I think that more flexible and static type checker-friendly signatures for the traverse methods would be:
ResourceGroovyMethods.traverse(File, Map<String, ?>, Closure)
ResourceGroovyMethods.traverse(File, Map<String, ?>)
Attachments
Issue Links
- links to