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

Regression: nested unchecked call does not trigger erasure of return type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • None
    • tools
    • b104
    • Verified

      This program fails to compile after JDK-JDK-8147493:

      abstract class Test {

       interface R<E> {}
       interface Q<T> {}
       interface T { <E> Q<E> n(R<E> r); }
       abstract <T> T isA(Class<T> t);
       abstract <T> S<T> w(T t);
       interface S<T> { S<T> t(T value); }

       void f(T t, Q<String> q) {
         w(t.n(isA(R.class))).t(q);
       }
      }


      error: incompatible types: Q<String> cannot be converted to Q<Object>
         w(t.n(isA(R.class))).t(q);
                                

            dlsmith Dan Smith
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: