/* * @test /nodynamiccopyright/ * @bug 8043893 * @summary Inference doesn't report error on incompatible upper bounds * * @compile -source 7 T8043893.java * @compile/fail/ref=T8043893.out -Xlint:-options -XDrawDiagnostics -source 8 T8043893.java */ class T8043893 { interface S1 { } interface S2 { } interface T0 { } interface T1 extends S1, S2 { } interface T2 extends S1, S2 { } interface T3 extends S1, S2 { } interface T4 extends S1 { } interface T5 extends S1 { } void m_intersection(T8043893 a) { } void m_class(T8043893 a) { } void test() { //intersection type checks m_intersection(new T8043893()); //ok in both 7 and 8 - Z = T1 m_intersection(new T8043893()); //ok in 7, fails in 8 m_intersection(new T8043893()); //ok in 7, fails in 8 m_intersection(new T8043893()); //ok in both 7 and 8 - Z = T0 & T1 //class type checks m_class(new T8043893()); //ok in both 7 and 8 - Z = T4 m_class(new T8043893()); //ok in 7, fails in 8 m_class(new T8043893()); //ok in both 7 and 8 - Z = T0 & T4 } }