langtools/test/tools/javac/capture/Capture2.java
author sogoel
Thu, 05 Jun 2014 10:44:38 -0700
changeset 24796 f940af3221e2
parent 5520 86e4b9a9da40
permissions -rw-r--r--
8044064: Group 1: create .out files for cast and capture negative tests in tools/javac dir Reviewed-by: jjg

/*
 * @test /nodynamiccopyright/
 * @bug 5029773
 * @summary soundness problem with failure to substitute wildcard as type formal argument
 * @author gafter
 *
 * @compile/fail/ref=Capture2.out -XDrawDiagnostics  Capture2.java
 */

package capture2;

class R<T extends R<T>> {
    T f() { return null; }
    T t;

    void x(R<?> r) {
        this.t = r.f().t; // this should be an error!
    }
}