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