improper handling of wildcard captures

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 6
    • Affects Version/s: 6
    • Component/s: tools
    • b71
    • 6
    • b85
    • generic
    • generic
    • Verified

      This program compiles with b71,
      but fails to compile with earlier mustang builds

      import java.util.*;

      public class rr {
          public static void main(String[] args) throws Throwable {
      List<?> x1 = new ArrayList<Integer>();
      List<?> x2 = new ArrayList<Integer>();
      x1.addAll(x2);
          }
      }

      The expected error is:

      rr.java:8: cannot find symbol
      symbol : method addAll(java.util.List<capture of ?>)
      location: interface java.util.List<capture of ?>
      x1.addAll(x2);
      ^
      1 error

      (although the error message could be improved)

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: