mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8074425: Group 13b: golden files for tests in tools/javac/generics dir
Reviewed-by: jjg, darcy, mcimadamore
This commit is contained in:
parent
1ebb022e1c
commit
f6428eb2bb
22 changed files with 58 additions and 279 deletions
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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
|
|
||||||
* @bug 4942201
|
* @bug 4942201
|
||||||
* @summary java allows class literal on generic type parameter array
|
* @summary java allows class literal on generic type parameter array
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile/fail GenLit2.java
|
* @compile/fail/ref=GenLit2.out -XDrawDiagnostics GenLit2.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package genLit2;
|
package genLit2;
|
||||||
|
|
2
langtools/test/tools/javac/generics/GenLit2.out
Normal file
2
langtools/test/tools/javac/generics/GenLit2.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
GenLit2.java:13:18: compiler.err.type.var.cant.be.deref
|
||||||
|
1 error
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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
|
|
||||||
* @bug 4919255 4982096 5004321
|
* @bug 4919255 4982096 5004321
|
||||||
* @summary the type of x.getClass() is no longer Class<? extends X>
|
* @summary the type of x.getClass() is no longer Class<? extends X>
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile/fail GetClass.java
|
* @compile/fail/ref=GetClass.out -XDrawDiagnostics GetClass.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class GetClass {
|
public class GetClass {
|
||||||
|
|
2
langtools/test/tools/javac/generics/GetClass.out
Normal file
2
langtools/test/tools/javac/generics/GetClass.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
GetClass.java:12:69: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.Class<compiler.misc.type.captureof: 1, ? extends java.lang.Class>, java.lang.Class<? extends java.lang.Class<GetClass>>)
|
||||||
|
1 error
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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
|
|
||||||
* @bug 4984158
|
* @bug 4984158
|
||||||
* @summary two inherited methods with same signature
|
* @summary two inherited methods with same signature
|
||||||
* @author darcy
|
* @author darcy
|
||||||
*
|
*
|
||||||
* @compile/fail InheritanceConflict3.java
|
* @compile/fail/ref=InheritanceConflict3.out -XDrawDiagnostics InheritanceConflict3.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package inheritance.conflict3;
|
package inheritance.conflict3;
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
InheritanceConflict3.java:14:10: compiler.err.name.clash.same.erasure: f(java.lang.Object), f(T)
|
||||||
|
InheritanceConflict3.java:17:1: compiler.err.concrete.inheritance.conflict: f(java.lang.Object), inheritance.conflict3.X1, f(T), inheritance.conflict3.X1, inheritance.conflict3.X1
|
||||||
|
2 errors
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* @ bug
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* @bug 4982096 5004321
|
|
||||||
* @summary the type in an instanceof expression must be reifiable
|
* @summary the type in an instanceof expression must be reifiable
|
||||||
* @author seligman
|
* @author seligman
|
||||||
*
|
*
|
||||||
* @compile/fail InstanceOf3.java
|
* @compile/fail/ref=InstanceOf3.out -XDrawDiagnostics InstanceOf3.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class InstanceOf3 {
|
public class InstanceOf3 {
|
||||||
|
|
2
langtools/test/tools/javac/generics/InstanceOf3.out
Normal file
2
langtools/test/tools/javac/generics/InstanceOf3.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
InstanceOf3.java:12:48: compiler.err.illegal.generic.type.for.instof
|
||||||
|
1 error
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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
|
|
||||||
* @bug 4482403
|
* @bug 4482403
|
||||||
* @summary javac failed to check second bound
|
* @summary javac failed to check second bound
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile/fail Multibound1.java
|
* @compile/fail/ref=Multibound1.out -XDrawDiagnostics Multibound1.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package Multibound1;
|
package Multibound1;
|
||||||
|
|
2
langtools/test/tools/javac/generics/Multibound1.out
Normal file
2
langtools/test/tools/javac/generics/Multibound1.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Multibound1.java:16:19: compiler.err.not.within.bounds: Multibound1.D, T
|
||||||
|
1 error
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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
|
|
||||||
* @bug 4471667
|
* @bug 4471667
|
||||||
* @summary compiler allows overriding with different primitive return type
|
* @summary compiler allows overriding with different primitive return type
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile/fail PrimitiveVariant.java
|
* @compile/fail/ref=PrimitiveVariant.out -XDrawDiagnostics PrimitiveVariant.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package PrimitiveVariant;
|
package PrimitiveVariant;
|
||||||
|
|
3
langtools/test/tools/javac/generics/PrimitiveVariant.out
Normal file
3
langtools/test/tools/javac/generics/PrimitiveVariant.out
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
PrimitiveVariant.java:20:1: compiler.err.does.not.override.abstract: PrimitiveVariant.Main, m(), PrimitiveVariant.I
|
||||||
|
PrimitiveVariant.java:21:18: compiler.err.override.incompatible.ret: (compiler.misc.cant.implement: m(), PrimitiveVariant.Main, m(), PrimitiveVariant.I), short, double
|
||||||
|
2 errors
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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
|
|
||||||
* @bug 4992316
|
* @bug 4992316
|
||||||
* @summary compiler allows new array of array of type parameter
|
* @summary compiler allows new array of array of type parameter
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile/fail UncheckedArray.java
|
* @compile/fail/ref=UncheckedArray.out -XDrawDiagnostics UncheckedArray.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package unchecked.array;
|
package unchecked.array;
|
||||||
|
|
2
langtools/test/tools/javac/generics/UncheckedArray.out
Normal file
2
langtools/test/tools/javac/generics/UncheckedArray.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
UncheckedArray.java:14:20: compiler.err.generic.array.creation
|
||||||
|
1 error
|
|
@ -1,34 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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
|
|
||||||
* @bug 4951260
|
* @bug 4951260
|
||||||
* @summary compiler disallows raw call to generic constructor
|
* @summary compiler disallows raw call to generic constructor
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile -Werror UncheckedConstructor.java
|
* @compile -Werror UncheckedConstructor.java
|
||||||
* @compile/fail -Werror -Xlint:unchecked UncheckedConstructor.java
|
* @compile/fail/ref=UncheckedConstructor.out -XDrawDiagnostics -Werror -Xlint:unchecked UncheckedConstructor.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
UncheckedConstructor.java:18:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.util.Enumeration<java.lang.Object>, compiler.misc.anonymous.class: java.util.Enumeration, kindname.class, G3
|
||||||
|
UncheckedConstructor.java:18:16: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), compiler.misc.anonymous.class: java.util.Enumeration, java.util.Enumeration<java.lang.Object>
|
||||||
|
- compiler.err.warnings.and.werror
|
||||||
|
1 error
|
||||||
|
2 warnings
|
|
@ -1,33 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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
|
|
||||||
* @ bug
|
|
||||||
* @summary Negative regression test from odersky
|
* @summary Negative regression test from odersky
|
||||||
* @author odersky
|
* @author odersky
|
||||||
*
|
*
|
||||||
* @compile/fail BadTest.java
|
* @compile/fail/ref=BadTest.out -XDrawDiagnostics BadTest.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class BadTest {
|
class BadTest {
|
||||||
|
|
5
langtools/test/tools/javac/generics/odersky/BadTest.out
Normal file
5
langtools/test/tools/javac/generics/odersky/BadTest.out
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
BadTest.java:18:50: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: List<java.lang.Object>, List<Cell<java.lang.String>>)
|
||||||
|
BadTest.java:22:48: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: List<java.lang.Object>, List<java.lang.String>)
|
||||||
|
BadTest.java:23:54: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: List<java.lang.Object>, List<Cell<java.lang.String>>)
|
||||||
|
BadTest.java:25:53: compiler.err.illegal.generic.type.for.instof
|
||||||
|
4 errors
|
|
@ -1,33 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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
|
|
||||||
* @ bug
|
|
||||||
* @summary Negative regression test from odersky
|
* @summary Negative regression test from odersky
|
||||||
* @author odersky
|
* @author odersky
|
||||||
*
|
*
|
||||||
* @compile/fail BadTest3.java
|
* @compile/fail/ref=BadTest3.out -XDrawDiagnostics BadTest3.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class BadTest3 {
|
class BadTest3 {
|
||||||
|
|
4
langtools/test/tools/javac/generics/odersky/BadTest3.out
Normal file
4
langtools/test/tools/javac/generics/odersky/BadTest3.out
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
BadTest3.java:31:34: compiler.err.prob.found.req: (compiler.misc.incompatible.eq.upper.bounds: B, java.lang.String, BadTest3.Ord)
|
||||||
|
BadTest3.java:33:13: compiler.err.cant.apply.symbol: kindname.method, f, B, List<BadTest3.Ord>, kindname.class, BadTest3.Main, (compiler.misc.incompatible.upper.lower.bounds: B, BadTest3.I,BadTest3.J, List<B>)
|
||||||
|
BadTest3.java:35:19: compiler.err.cant.apply.symbol: kindname.method, f, B, List<BadTest3.Ord>, kindname.class, BadTest3.Main, (compiler.misc.incompatible.upper.lower.bounds: B, BadTest3.I,BadTest3.J, List<B>)
|
||||||
|
3 errors
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* @bug 4736963
|
||||||
*
|
|
||||||
* 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
|
|
||||||
* @bug 8007464
|
|
||||||
* @summary Negative regression test from odersky
|
* @summary Negative regression test from odersky
|
||||||
* @author odersky
|
* @author odersky
|
||||||
*
|
*
|
||||||
* @compile/fail -source 7 BadTest4.java
|
* @compile/fail/ref=BadTest4.out -XDrawDiagnostics -source 7 BadTest4.java
|
||||||
* @compile BadTest4.java
|
* @compile BadTest4.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
4
langtools/test/tools/javac/generics/odersky/BadTest4.out
Normal file
4
langtools/test/tools/javac/generics/odersky/BadTest4.out
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
- compiler.warn.source.no.bootclasspath: 1.7
|
||||||
|
BadTest4.java:38:17: compiler.err.cant.apply.symbol: kindname.method, f, A,B, java.lang.Integer,java.lang.Number, kindname.class, BadTest4.Main, (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Number, java.lang.Integer)
|
||||||
|
1 error
|
||||||
|
1 warning
|
Loading…
Add table
Add a link
Reference in a new issue