Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-10651

STC: closure parameter type inference for raw type that is iterable over type parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.17, 3.0.11, 4.0.3
    • 4.0.4, 3.0.20
    • Static Type Checker
    • None

    Description

      Consider the following:

      abstract class TreeNode<TN extends TreeNode<?>> implements Iterable<TN> {
        @Override
        Iterator<TN> iterator() {
        }
      }
      
      void proc(TreeNode node) {
        node.eachWithIndex { child, index ->
          proc(child) // Cannot find matching method #proc(java.lang.Object)
        }
      }
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: