Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6456971

Varargs and inference problem

XMLWordPrintable

    • generic
    • generic

      This program does not compile:

      import java.util.List;

      public class Main {
           static <T> T[] makeArray(T... args) {
               return args;
           }

           public static <S> void test() {
               S[] stringLists = makeArray(null, null);
           }
      }

            ahe Peter Ahe
            ahe Peter Ahe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: