test/tools/javac/generics/inference/6215213/T6215213.java

Mon, 26 Oct 2015 13:23:30 -0700

author
asaha
date
Mon, 26 Oct 2015 13:23:30 -0700
changeset 2999
683b3e7e05a7
parent 554
9d9f26857129
child 2525
2eb010b6cb22
permissions
-rw-r--r--

Added tag jdk8u76-b00 for changeset 10ffafaf5340

duke@1 1 /*
ohair@554 2 * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation.
duke@1 8 *
duke@1 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 13 * accompanied this code).
duke@1 14 *
duke@1 15 * You should have received a copy of the GNU General Public License version
duke@1 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 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.
duke@1 22 */
duke@1 23
duke@1 24 /*
duke@1 25 * @test
duke@1 26 * @bug 6215213
duke@1 27 * @summary Compiler JDK1.5 crashes with uses of generics
duke@1 28 * @author Peter von der Ah\u00e9
duke@1 29 * @compile T6215213.java
duke@1 30 */
duke@1 31
duke@1 32 public class T6215213 {
duke@1 33 static class Box<T> {}
duke@1 34 static class Box1<T extends T6215213> {}
duke@1 35 static class Pair<T, S> {}
duke@1 36 static class Pair1<T extends T6215213, S> {}
duke@1 37 static class Triple<T, S, U> {}
duke@1 38 static class Triple1<T extends T6215213, S, U extends T6215213> {}
duke@1 39 static class Quad<T, S, U, V> {}
duke@1 40 static class Quad1<T extends T6215213, S, U extends T6215213, V> {}
duke@1 41
duke@1 42 <T> Box<T> testBox(T t) { return null; }
duke@1 43 <T extends T6215213> Box1<T> testBox1(T t) { return null; }
duke@1 44 <T> Pair<T, T> testPair(T t) { return null; }
duke@1 45 <T extends T6215213> Pair1<T, T> testPair1(T t) { return null; }
duke@1 46 <T> Triple<T, T, T> testTriple(T t) { return null; }
duke@1 47 <T extends T6215213> Triple1<T, T, T> testTriple1(T t) { return null; }
duke@1 48 <T> Quad<T, T, T, T> testQuad(T t) { return null; }
duke@1 49 <T extends T6215213> Quad1<T, T, T, T> testQuad1(T t) { return null; }
duke@1 50
duke@1 51 void testAll() {
duke@1 52 Box<?> box = testBox(null);
duke@1 53 Box1<?> box1 = testBox1(null);
duke@1 54 Pair<?, ?> pair = testPair(null);
duke@1 55 Pair1<?, ?> pair1 = testPair1(null);
duke@1 56 Triple<?, ?, ?> triple = testTriple(null);
duke@1 57 Triple1<?, ?, ?> triple1 = testTriple1(null);
duke@1 58 Quad<?, ?, ?, ?> quad = testQuad(null);
duke@1 59 Quad1<?, ?, ?, ?> quad1 = testQuad1(null);
duke@1 60 }
duke@1 61 }

mercurial