langtools/test/tools/javac/generics/inference/CaptureLowerBoundNeg.java
author dlsmith
Fri, 20 Feb 2015 17:05:13 -0700
changeset 29146 7115a5967ed1
child 42819 4ce83e629dc1
permissions -rw-r--r--
8039214: Inference should not map capture variables to their upper bounds Summary: Update to Types.containsType; related adjustment to most-specific test Reviewed-by: mcimadamore, vromero

/*
 * @test /nodynamiccopyright/
 * @bug 8039214
 * @summary Capture variable as an inference variable's lower bound
 * @compile/fail/ref=CaptureLowerBoundNeg.out -XDrawDiagnostics CaptureLowerBoundNeg.java
 */

public class CaptureLowerBoundNeg {

    static class D<T> {
        void take(T arg) {}
        static <T> D<T> make(Class<? extends T> c) { return new D<T>(); }
    }

    void test(Object o) {
        D.make(o.getClass()).take(o);
    }

}