test/tools/javac/OverrideChecks/6400189/T6400189b.java

Wed, 25 Mar 2009 10:29:28 +0000

author
mcimadamore
date
Wed, 25 Mar 2009 10:29:28 +0000
changeset 254
1ee128971f5d
child 384
ed31953ca025
permissions
-rw-r--r--

6400189: raw types and inference
Summary: Fixed resolution problem with raw overriding (CCC)
Reviewed-by: jjg

mcimadamore@254 1 /*
mcimadamore@254 2 * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
mcimadamore@254 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mcimadamore@254 4 *
mcimadamore@254 5 * This code is free software; you can redistribute it and/or modify it
mcimadamore@254 6 * under the terms of the GNU General Public License version 2 only, as
mcimadamore@254 7 * published by the Free Software Foundation.
mcimadamore@254 8 *
mcimadamore@254 9 * This code is distributed in the hope that it will be useful, but WITHOUT
mcimadamore@254 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mcimadamore@254 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mcimadamore@254 12 * version 2 for more details (a copy is included in the LICENSE file that
mcimadamore@254 13 * accompanied this code).
mcimadamore@254 14 *
mcimadamore@254 15 * You should have received a copy of the GNU General Public License version
mcimadamore@254 16 * 2 along with this work; if not, write to the Free Software Foundation,
mcimadamore@254 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mcimadamore@254 18 *
mcimadamore@254 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
mcimadamore@254 20 * CA 95054 USA or visit www.sun.com if you need additional information or
mcimadamore@254 21 * have any questions.
mcimadamore@254 22 */
mcimadamore@254 23
mcimadamore@254 24 /*
mcimadamore@254 25 * @test
mcimadamore@254 26 * @bug 6400189
mcimadamore@254 27 * @summary raw types and inference
mcimadamore@254 28 * @author mcimadamore
mcimadamore@254 29 * @compile/fail/ref=T6400189b.out T6400189b.java -Xlint:unchecked -XDrawDiagnostics
mcimadamore@254 30 */
mcimadamore@254 31
mcimadamore@254 32 class T6400189b<T> {
mcimadamore@254 33
mcimadamore@254 34 static class A {
mcimadamore@254 35 <T> T m(T6400189b<T> x) {
mcimadamore@254 36 return null;
mcimadamore@254 37 }
mcimadamore@254 38 }
mcimadamore@254 39
mcimadamore@254 40 static class B<T> extends A {
mcimadamore@254 41 <T> T m(T6400189b<T> x) {
mcimadamore@254 42 return null;
mcimadamore@254 43 }
mcimadamore@254 44 }
mcimadamore@254 45
mcimadamore@254 46 void test(B b) {
mcimadamore@254 47 Integer i = b.m(new T6400189b<Integer>());
mcimadamore@254 48 }
mcimadamore@254 49 }

mercurial