blob: 76f4d6b811c4449683b5322435d8b9f9e5f4b3e8 [file]
import groovy.transform.CompileStatic
import groovy.transform.stc.ClosureParams
import groovy.transform.stc.FromString
class Foo {
void bar() {
println 'Haha!'
}
}
class Tor<D,U> {
public void foo(@ClosureParams(value=FromString,options=["D,List<U>"]) Closure cl) { cl.call(3, [new Foo(), new Foo()]) }
}
@CompileStatic
def test() {
def tor = new Tor<Integer,Foo>()
tor.foo (r, e) -> { r.times (t) -> { e.each (it) -> { it.bar() } } }
}