test/tools/javac/varargs/access/VarargsAndWildcardParameterizedTypeTest.java

Fri, 17 Apr 2015 08:55:59 -0600

author
dlsmith
date
Fri, 17 Apr 2015 08:55:59 -0600
changeset 2788
f08330fad341
parent 2535
test/tools/javac/varargs/T8049075/VarargsAndWildcardParameterizedTypeTest.java@4b4841501dd9
permissions
-rw-r--r--

8075520: Varargs access check mishandles capture variables
8077786: Check varargs access against inferred signature
Reviewed-by: vromero

vromero@2535 1 /*
vromero@2535 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
vromero@2535 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
vromero@2535 4 *
vromero@2535 5 * This code is free software; you can redistribute it and/or modify it
vromero@2535 6 * under the terms of the GNU General Public License version 2 only, as
vromero@2535 7 * published by the Free Software Foundation.
vromero@2535 8 *
vromero@2535 9 * This code is distributed in the hope that it will be useful, but WITHOUT
vromero@2535 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
vromero@2535 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
vromero@2535 12 * version 2 for more details (a copy is included in the LICENSE file that
vromero@2535 13 * accompanied this code).
vromero@2535 14 *
vromero@2535 15 * You should have received a copy of the GNU General Public License version
vromero@2535 16 * 2 along with this work; if not, write to the Free Software Foundation,
vromero@2535 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
vromero@2535 18 *
vromero@2535 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
vromero@2535 20 * or visit www.oracle.com if you need additional information or have any
vromero@2535 21 * questions.
vromero@2535 22 */
vromero@2535 23
vromero@2535 24 /*
vromero@2535 25 * @test
vromero@2535 26 * @bug 8049075
vromero@2535 27 * @summary javac, wildcards and generic vararg method invocation not accepted
vromero@2535 28 * @compile VarargsAndWildcardParameterizedTypeTest.java
dlsmith@2788 29 * @compile -source 8 VarargsAndWildcardParameterizedTypeTest.java
dlsmith@2788 30 * @compile -source 7 VarargsAndWildcardParameterizedTypeTest.java
vromero@2535 31 */
vromero@2535 32
vromero@2535 33 class VarargsAndWildcardParameterizedTypeTest {
vromero@2535 34 interface I<T> {
vromero@2535 35 String m(T... t);
vromero@2535 36 }
vromero@2535 37
vromero@2535 38 void m() {
vromero@2535 39 I<? super Integer> i = null;
vromero@2535 40 i.m(Integer.valueOf(1), Integer.valueOf(1));
vromero@2535 41 }
vromero@2535 42 }

mercurial