Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.7
-
None
Description
@groovy.transform.CompileStatic class MyClass { void method() { final cl = { Object[] args -> println "cl: ${args}" } cl('c1-1', 'c1-2') } } class MyClass2 { void method() { final cl = { Object[] args -> println "cl2: ${args}" } cl('c1-1', 'c1-2') } } new MyClass().method() new MyClass2().method()
Produces the output:
cl: [[c1-1, c1-2]] cl2: [c1-1, c1-2]
indicating that the Closure in the statically-compiled MyClass is receiving the arguments wrapped in an additional Object[].