1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
import java.util.Comparator;
import testchecker.quals.H1S1;
import testchecker.quals.H1S2;
class AnonymousClasses {
private <@H1S1 T extends @H1S1 Comparator<T>> void testGenericAnonymous() {
// :: error: (type.argument.type.incompatible) :: error: (constructor.invocation.invalid)
new @H1S1 Gen<T>() {};
// :: error: (type.argument.type.incompatible) :: warning:
// (cast.unsafe.constructor.invocation)
new @H1S1 GenInter<T>() {};
}
}
class Gen<@H1S2 F extends @H1S2 Object> {
// :: error: (super.invocation.invalid) :: warning: (inconsistent.constructor.type)
public @H1S2 Gen() {}
}
interface GenInter<@H1S2 F extends @H1S2 Object> {}
interface Foo {}
|