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

DefaultGroovyMethods class's plus(T[] left, xxxx<T> right) have ambiguous errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Cannot Reproduce
    • 2.4.3
    • None
    • syntax
    • None
    • OS: Arch Linux
      Kernel: x86_64 Linux 3.19.3-3-ARCH
      CPU: Intel Core i7-3770S CPU @ 3.9GHz
      GPU: GeForce GT 640M
      RAM: 7875MB

      Using IntelliJ IDEA 1:14.1.1-1
    • Patch

    Description

      Trying to use the `groovy.transform.etc` for the first time. When I run it, all works well until it gets to `org.codehaus.groovy.runtime.DefaultGroovyMethods.java`

      There are a few problems with how the public static <T> T[] plus(T[] left, xxx right) method. Where xxx is T[], Iterable<T> right, or Collection<T> right.

      In all of these cases, you just need to change:
      return (T[]) plus(...).toArray();
      to
      return (T[]) plus((Collection<T>)...).toArray();

      Problem solved if you follow these instructions.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              czipperz Czipperz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: