You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Jochen Theodorou (JIRA)" <ji...@apache.org> on 2015/06/03 08:01:49 UTC

[jira] [Created] (GROOVY-7451) list to closure argument matching passes unexpectedly

Jochen Theodorou created GROOVY-7451:
----------------------------------------

             Summary: list to closure argument matching passes unexpectedly
                 Key: GROOVY-7451
                 URL: https://issues.apache.org/jira/browse/GROOVY-7451
             Project: Groovy
          Issue Type: Bug
          Components: Static Type Checker
            Reporter: Jochen Theodorou
            Assignee: Cédric Champeau


{code:Java}
@groovy.transform.TypeChecked
def myMethod() {
  [[6, 3]].each { a, b -> println "$a $b" }  
  [[2, 4, 6]].each { c, d -> println "$c $d" }    // MME
  [[1, 3]].each { u, v, w -> println "$u $v w" }  // MME
}
myMethod()
{code}
None of those method calls should have passed the typechecker, but they all do and the later two fail at runtime. This behavior is independent of if a list literal is used or not.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)