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

Type checker select the wrong inject method

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.2
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      In the following example:

      ['a','bb','ccc'].inject(0) { int acc, String str -> acc += str.length(); acc }
      

      The type checker thinks the method to be called is DGM#inject(Object,Object,Closure) instead of DGM#inject(Collection,Object,Closure)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: