test/tools/javac/generics/7022054/T7022054pos2.java

Thu, 03 Mar 2011 17:34:58 +0000

author
mcimadamore
date
Thu, 03 Mar 2011 17:34:58 +0000
changeset 907
32565546784b
child 1393
d7d932236fee
permissions
-rw-r--r--

7022054: Invalid compiler error on covariant overriding methods with the same erasure
Summary: Rules for method clash use notion of subsignature, which is sometimes too strict and incompatible with JDK 6
Reviewed-by: jjg

mcimadamore@907 1 /*
mcimadamore@907 2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
mcimadamore@907 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mcimadamore@907 4 *
mcimadamore@907 5 * This code is free software; you can redistribute it and/or modify it
mcimadamore@907 6 * under the terms of the GNU General Public License version 2 only, as
mcimadamore@907 7 * published by the Free Software Foundation.
mcimadamore@907 8 *
mcimadamore@907 9 * This code is distributed in the hope that it will be useful, but WITHOUT
mcimadamore@907 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mcimadamore@907 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mcimadamore@907 12 * version 2 for more details (a copy is included in the LICENSE file that
mcimadamore@907 13 * accompanied this code).
mcimadamore@907 14 *
mcimadamore@907 15 * You should have received a copy of the GNU General Public License version
mcimadamore@907 16 * 2 along with this work; if not, write to the Free Software Foundation,
mcimadamore@907 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mcimadamore@907 18 *
mcimadamore@907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mcimadamore@907 20 * or visit www.oracle.com if you need additional information or have any
mcimadamore@907 21 * questions.
mcimadamore@907 22 */
mcimadamore@907 23
mcimadamore@907 24 /*
mcimadamore@907 25 * @test
mcimadamore@907 26 * @bug 7022054
mcimadamore@907 27 *
mcimadamore@907 28 * @summary Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore@907 29 * @compile T7022054pos2.java
mcimadamore@907 30 *
mcimadamore@907 31 */
mcimadamore@907 32
mcimadamore@907 33 class T7022054pos2 {
mcimadamore@907 34 static class A {
mcimadamore@907 35 static A m(String s) { return null; }
mcimadamore@907 36 }
mcimadamore@907 37 static class B extends A {
mcimadamore@907 38 static <X extends B> X m(String s) { return null; }
mcimadamore@907 39 }
mcimadamore@907 40 }

mercurial