8075164: Group 14b: golden files for tests in tools/javac/generics/wildcards dir

Reviewed-by: jjg, vromero
This commit is contained in:
Sonali Goel 2015-05-15 16:59:34 -07:00
parent f6428eb2bb
commit 395f1173a9
10 changed files with 21 additions and 379 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,10 +25,10 @@
* @test
* @summary Test subtyping for wildcards with related type bounds.
*
* @compile AssignmentDifferentTypes1.java
* @compile/fail/ref=AssignmentDifferentTypes.out -XDrawDiagnostics AssignmentDifferentTypes.java
*/
public class AssignmentDifferentTypes1 {
public class AssignmentDifferentTypes {
public static void main(String[] args) {
Ref<Der> derexact = null;
@ -42,6 +42,15 @@ public class AssignmentDifferentTypes1 {
baseext = derexact; // <<pass>> <? extends Base> = <Der>
dersuper = basesuper; // <<pass>> <? super Der> = <? super Base>
dersuper = baseexact; // <<pass>> <? super Der> = <Base>
derexact = baseexact; // <<fail>> <Der> = <Base>
baseexact = derexact; // <<fail>> <Base> = <Der>
derext = baseext; // <<fail>> <? extends Der> = <? extends Base>
derext = baseexact; // <<fail>> <? extends Der> = <Base>
derext = basesuper; // <<fail>> <? extends Der> = <? super Base>
baseext = dersuper; // <<fail>> <? extends Base> = <? super Der>
basesuper = dersuper; // <<fail>> <? super Base> = <? super Der>
basesuper = derexact; // <<fail>> <? super Base> = <Der>
}
}

View File

@ -0,0 +1,9 @@
AssignmentDifferentTypes.java:46:20: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: Ref<Base>, Ref<Der>)
AssignmentDifferentTypes.java:47:21: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: Ref<Der>, Ref<Base>)
AssignmentDifferentTypes.java:48:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: Ref<compiler.misc.type.captureof: 1, ? extends Base>, Ref<? extends Der>)
AssignmentDifferentTypes.java:49:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: Ref<Base>, Ref<? extends Der>)
AssignmentDifferentTypes.java:50:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: Ref<compiler.misc.type.captureof: 1, ? super Base>, Ref<? extends Der>)
AssignmentDifferentTypes.java:51:19: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: Ref<compiler.misc.type.captureof: 1, ? super Der>, Ref<? extends Base>)
AssignmentDifferentTypes.java:52:21: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: Ref<compiler.misc.type.captureof: 1, ? super Der>, Ref<? super Base>)
AssignmentDifferentTypes.java:53:21: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: Ref<Der>, Ref<? super Base>)
8 errors

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary Test subtyping for wildcards with related type bounds.
*
* @compile/fail AssignmentDifferentTypes2.java
*/
public class AssignmentDifferentTypes2 {
public static void main(String[] args) {
Ref<Der> derexact = null;
Ref<Base> baseexact = null;
Ref<? extends Der> derext = null;
Ref<? extends Base> baseext = null;
Ref<? super Der> dersuper = null;
Ref<? super Base> basesuper = null;
derexact = baseexact; // <<fail>> <Der> = <Base>
}
}
class Ref<T> {}
class Base {}
class Der extends Base {}

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary Test subtyping for wildcards with related type bounds.
*
* @compile/fail AssignmentDifferentTypes3.java
*/
public class AssignmentDifferentTypes3 {
public static void main(String[] args) {
Ref<Der> derexact = null;
Ref<Base> baseexact = null;
Ref<? extends Der> derext = null;
Ref<? extends Base> baseext = null;
Ref<? super Der> dersuper = null;
Ref<? super Base> basesuper = null;
baseexact = derexact; // <<fail>> <Base> = <Der>
}
}
class Ref<T> {}
class Base {}
class Der extends Base {}

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary Test subtyping for wildcards with related type bounds.
*
* @compile/fail AssignmentDifferentTypes4.java
*/
public class AssignmentDifferentTypes4 {
public static void main(String[] args) {
Ref<Der> derexact = null;
Ref<Base> baseexact = null;
Ref<? extends Der> derext = null;
Ref<? extends Base> baseext = null;
Ref<? super Der> dersuper = null;
Ref<? super Base> basesuper = null;
derext = baseext; // <<fail>> <? extends Der> = <? extends Base>
}
}
class Ref<T> {}
class Base {}
class Der extends Base {}

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary Test subtyping for wildcards with related type bounds.
*
* @compile/fail AssignmentDifferentTypes5.java
*/
public class AssignmentDifferentTypes5 {
public static void main(String[] args) {
Ref<Der> derexact = null;
Ref<Base> baseexact = null;
Ref<? extends Der> derext = null;
Ref<? extends Base> baseext = null;
Ref<? super Der> dersuper = null;
Ref<? super Base> basesuper = null;
derext = baseexact; // <<fail>> <? extends Der> = <Base>
}
}
class Ref<T> {}
class Base {}
class Der extends Base {}

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary Test subtyping for wildcards with related type bounds.
*
* @compile/fail AssignmentDifferentTypes6.java
*/
public class AssignmentDifferentTypes6 {
public static void main(String[] args) {
Ref<Der> derexact = null;
Ref<Base> baseexact = null;
Ref<? extends Der> derext = null;
Ref<? extends Base> baseext = null;
Ref<? super Der> dersuper = null;
Ref<? super Base> basesuper = null;
derext = basesuper; // <<fail>> <? extends Der> = <? super Base>
}
}
class Ref<T> {}
class Base {}
class Der extends Base {}

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary Test subtyping for wildcards with related type bounds.
*
* @compile/fail AssignmentDifferentTypes7.java
*/
public class AssignmentDifferentTypes7 {
public static void main(String[] args) {
Ref<Der> derexact = null;
Ref<Base> baseexact = null;
Ref<? extends Der> derext = null;
Ref<? extends Base> baseext = null;
Ref<? super Der> dersuper = null;
Ref<? super Base> basesuper = null;
baseext = dersuper; // <<fail>> <? extends Base> = <? super Der>
}
}
class Ref<T> {}
class Base {}
class Der extends Base {}

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary Test subtyping for wildcards with related type bounds.
*
* @compile/fail AssignmentDifferentTypes8.java
*/
public class AssignmentDifferentTypes8 {
public static void main(String[] args) {
Ref<Der> derexact = null;
Ref<Base> baseexact = null;
Ref<? extends Der> derext = null;
Ref<? extends Base> baseext = null;
Ref<? super Der> dersuper = null;
Ref<? super Base> basesuper = null;
basesuper = dersuper; // <<fail>> <? super Base> = <? super Der>
}
}
class Ref<T> {}
class Base {}
class Der extends Base {}

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary Test subtyping for wildcards with related type bounds.
*
* @compile/fail AssignmentDifferentTypes9.java
*/
public class AssignmentDifferentTypes9 {
public static void main(String[] args) {
Ref<Der> derexact = null;
Ref<Base> baseexact = null;
Ref<? extends Der> derext = null;
Ref<? extends Base> baseext = null;
Ref<? super Der> dersuper = null;
Ref<? super Base> basesuper = null;
basesuper = derexact; // <<fail>> <? super Base> = <Der>
}
}
class Ref<T> {}
class Base {}
class Der extends Base {}