reopen JDK-8063054?

Liam Miller-Cushon cushon at google.com
Wed Nov 23 03:34:50 UTC 2016


JDK-8063054 was marked 'cannot reproduce', but I'm still seeing this issue
with 9-ea+145:

$ cat Test.java
class Test {
  void test(Box<? extends Box<Number>> b) {
    Number n = b.<Number>map(Box::get).get();
  }
}

interface Func<S,T> { T apply(S arg); }

interface Box<T> {
  T get();
  <R> Box<R> map(Func<T,R> f);
}
$ javac -Xlint:rawtypes Test.java
Test.java:3: warning: [rawtypes] found raw type: Box
    Number n = b.<Number>map(Box::get).get();
                             ^
  missing type arguments for generic class Box<T>
  where T is a type-variable:
    T extends Object declared in interface Box
1 warning

$ cat Test.java
interface Consumer<T> { void accept(T arg); }
interface Parent<P> { void foo(); }
interface Child extends Parent<String> {}

class Test {
  static <T> void m(T arg, Consumer<T> f) {}

  public void test(Child c) { m(c, Parent::foo); }
}
$ javac -Xlint:rawtypes Test.java
Test.java:8: warning: [rawtypes] found raw type: Parent
  public void test(Child c) { m(c, Parent::foo); }
                                   ^
  missing type arguments for generic class Parent<P>
  where P is a type-variable:
    P extends Object declared in interface Parent
1 warning
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20161122/0fb76b4b/attachment.html>


More information about the compiler-dev mailing list