T6295056.java revision 0:9a66ca7c79fa
11553Srgrimes/*
21553Srgrimes * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
31553Srgrimes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41553Srgrimes *
51553Srgrimes * This code is free software; you can redistribute it and/or modify it
61553Srgrimes * under the terms of the GNU General Public License version 2 only, as
71553Srgrimes * published by the Free Software Foundation.
81553Srgrimes *
91553Srgrimes * This code is distributed in the hope that it will be useful, but WITHOUT
101553Srgrimes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
111553Srgrimes * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
121553Srgrimes * version 2 for more details (a copy is included in the LICENSE file that
131553Srgrimes * accompanied this code).
141553Srgrimes *
151553Srgrimes * You should have received a copy of the GNU General Public License version
161553Srgrimes * 2 along with this work; if not, write to the Free Software Foundation,
171553Srgrimes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
181553Srgrimes *
191553Srgrimes * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
201553Srgrimes * CA 95054 USA or visit www.sun.com if you need additional information or
211553Srgrimes * have any questions.
221553Srgrimes */
231553Srgrimes
241553Srgrimes/*
251553Srgrimes * @test
261553Srgrimes * @bug     6295056
271553Srgrimes * @summary Unchecked cast not reported as unsafe
281553Srgrimes * @compile/fail -Xlint:unchecked -Werror T6295056.java
291553Srgrimes * @compile T6295056.java
301553Srgrimes */
311553Srgrimes
321553Srgrimespublic class T6295056 {
331553Srgrimes    interface Foo {}
341553Srgrimes    interface Bar<X> {}
351553Srgrimes
361553Srgrimes    Object m(Foo f) {
371553Srgrimes        return (Bar<Object>)f;
381553Srgrimes    }
391553Srgrimes
401553Srgrimes}
411553Srgrimes