Groovy Iterators: No signature of method: is applicable for argument types: (myFunction_closure1_closure3) -


i'm iterating on set of string values , passing each external function so:

list<string> myarray = ["a", "b", "c"]  myarray.each() {   myexternalfunction({it}) } 

however, i'm getting closure error above. why happening? {it} evaluate string when it's inside closure? why passing closure argument?

list<string> myarray = ["a", "b", "c"]  myarray.each {   myexternalfunction(it) } 

myexternalfunction excepts string present implementation {it} closure passed method. hence complain.

you can find more closures in groovy.


Comments