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

Varargs and inference problem

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      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);
           }
      }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: