groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Theodorou (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GROOVY-7451) list to closure argument matching passes unexpectedly
Date Wed, 03 Jun 2015 06:01:49 GMT
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)

Mime
View raw message