Mon, 24 Oct 2011 13:00:30 +0100
7098660: Write better overload resolution/inference tests
Summary: Add overload/inference debug diagnostics - added test harness using annotations to check outcome of overload resolution/inference
Reviewed-by: jjg
mcimadamore@187 | 1 | /* |
ohair@798 | 2 | * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. |
mcimadamore@187 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
mcimadamore@187 | 4 | * |
mcimadamore@187 | 5 | * This code is free software; you can redistribute it and/or modify it |
mcimadamore@187 | 6 | * under the terms of the GNU General Public License version 2 only, as |
mcimadamore@187 | 7 | * published by the Free Software Foundation. |
mcimadamore@187 | 8 | * |
mcimadamore@187 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
mcimadamore@187 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
mcimadamore@187 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
mcimadamore@187 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
mcimadamore@187 | 13 | * accompanied this code). |
mcimadamore@187 | 14 | * |
mcimadamore@187 | 15 | * You should have received a copy of the GNU General Public License version |
mcimadamore@187 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
mcimadamore@187 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
mcimadamore@187 | 18 | * |
ohair@554 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 20 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 21 | * questions. |
mcimadamore@187 | 22 | */ |
mcimadamore@187 | 23 | |
mcimadamore@187 | 24 | /* |
mcimadamore@187 | 25 | * @test |
mcimadamore@187 | 26 | * @bug 6558559 |
mcimadamore@187 | 27 | * @summary Extra "unchecked" diagnostic |
mcimadamore@187 | 28 | * @author Maurizio Cimadamore |
mcimadamore@187 | 29 | * |
mcimadamore@187 | 30 | * @compile T6558559b.java -Xlint:unchecked -Werror |
mcimadamore@187 | 31 | */ |
mcimadamore@187 | 32 | |
mcimadamore@187 | 33 | import java.util.*; |
mcimadamore@187 | 34 | |
mcimadamore@187 | 35 | class T6558559b { |
mcimadamore@187 | 36 | void test(List rawList, List<?> unboundList) { |
mcimadamore@187 | 37 | Throwable t0 = (Throwable) Collections.emptyList(); |
mcimadamore@187 | 38 | Throwable t1 = (Throwable) rawList; |
mcimadamore@187 | 39 | Throwable t2 = (Throwable) unboundList; |
mcimadamore@187 | 40 | Object o = unboundList; |
mcimadamore@187 | 41 | Throwable t3 = (Throwable) o; |
mcimadamore@187 | 42 | } |
jjg@525 | 43 | } |