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

Return type of "inject" is not inferred properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.6, 2.3.9
    • 5.0.0-alpha-3
    • Static compilation
    • None

    Description

      The return type of inject is not inferred properly. Currently, there's no rule allowing the type checker to infer the type. The signature of the method is:

      public static <T, U extends T, V extends T> T inject(Collection self, U initialValue, Closure<V> closure)
      

      So both U and V must be took into account to be able to infer the return type T.

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              melix Cédric Champeau
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: