groovy
  1. groovy
  2. GROOVY-5179

Implement type inference for for loop variable types

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-1
    • Fix Version/s: 2.0-beta-2
    • Component/s: Static Type Checker
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The following code should compile properly with static type checking activated:

      class A {
          String name
      }
      List<A> myList = [new A(name:'Cedric'), new A(name:'Yakari')] as LinkedList<A>
      for (element in myList) {
          element.name.toUpperCase()
      }
      

        Activity

          People

          • Assignee:
            CÚdric Champeau
            Reporter:
            CÚdric Champeau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: