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

Return type of "inject" is not inferred properly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.6, 2.3.9
    • Fix Version/s: None
    • Component/s: Static compilation
    • Labels:
      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

              • Assignee:
                Unassigned
                Reporter:
                melix C├ędric Champeau
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: