2010-04-14 11:31:55 +00:00
|
|
|
/*
|
|
|
|
* @test /nodynamiccopyright/
|
2015-03-30 11:39:14 +00:00
|
|
|
* @bug 6939620 7020044 8062373
|
2010-04-14 11:31:55 +00:00
|
|
|
*
|
2011-03-07 14:31:50 +00:00
|
|
|
* @summary Check that diamond works where LHS is supertype of RHS (nilary constructor)
|
2010-04-14 11:31:55 +00:00
|
|
|
* @author mcimadamore
|
|
|
|
* @compile/fail/ref=Neg06.out Neg06.java -XDrawDiagnostics
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
class Neg06 {
|
2015-03-30 11:39:14 +00:00
|
|
|
interface ISuperFoo<X> {}
|
|
|
|
interface IFoo<X extends Number> extends ISuperFoo<X> {}
|
2010-04-14 11:31:55 +00:00
|
|
|
|
|
|
|
static class CSuperFoo<X> {}
|
|
|
|
static class CFoo<X extends Number> extends CSuperFoo<X> {}
|
|
|
|
|
2015-03-30 11:39:14 +00:00
|
|
|
ISuperFoo<String> isf = new IFoo<>() {};
|
2010-04-14 11:31:55 +00:00
|
|
|
CSuperFoo<String> csf1 = new CFoo<>();
|
2015-03-30 11:39:14 +00:00
|
|
|
CSuperFoo<String> csf2 = new CFoo<>() {};
|
2010-04-14 11:31:55 +00:00
|
|
|
}
|