test/tools/javac/generics/typevars/5060485/Compatibility02.java

Thu, 06 Jun 2013 15:33:40 +0100

author
mcimadamore
date
Thu, 06 Jun 2013 15:33:40 +0100
changeset 1811
349160289ba2
parent 798
4868a36f6fd8
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8008627: Compiler mishandles three-way return-type-substitutability
Summary: Compiler should not enforce an order in how ambiguous methods should be resolved
Reviewed-by: jjg, vromero

mcimadamore@639 1 /*
ohair@798 2 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
mcimadamore@639 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mcimadamore@639 4 *
mcimadamore@639 5 * This code is free software; you can redistribute it and/or modify it
mcimadamore@639 6 * under the terms of the GNU General Public License version 2 only, as
mcimadamore@639 7 * published by the Free Software Foundation.
mcimadamore@639 8 *
mcimadamore@639 9 * This code is distributed in the hope that it will be useful, but WITHOUT
mcimadamore@639 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mcimadamore@639 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mcimadamore@639 12 * version 2 for more details (a copy is included in the LICENSE file that
mcimadamore@639 13 * accompanied this code).
mcimadamore@639 14 *
mcimadamore@639 15 * You should have received a copy of the GNU General Public License version
mcimadamore@639 16 * 2 along with this work; if not, write to the Free Software Foundation,
mcimadamore@639 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mcimadamore@639 18 *
mcimadamore@639 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mcimadamore@639 20 * or visit www.oracle.com if you need additional information or have any
mcimadamore@639 21 * questions.
mcimadamore@639 22 */
mcimadamore@639 23
mcimadamore@639 24 /*
mcimadamore@639 25 * @test
mcimadamore@639 26 * @bug 5060485 6977800
mcimadamore@639 27 * @summary The scope of a class type parameter is too wide
mcimadamore@639 28 * @author Maurizio Cimadamore
mcimadamore@639 29 * @compile/fail/ref=Compatibility02.out -XDrawDiagnostics Compatibility.java
mcimadamore@639 30 */
mcimadamore@639 31
mcimadamore@639 32 class NumberList<T extends Number> {}
mcimadamore@639 33
mcimadamore@639 34 class Test {
mcimadamore@639 35 <Y extends Number> void m() {
mcimadamore@639 36 static class Y {}
mcimadamore@639 37 class Y1<S extends NumberList<Y>> {}
mcimadamore@639 38 }
mcimadamore@639 39 }

mercurial