test/tools/javac/annotations/typeAnnotations/failures/TypeVariableCycleTest.java

Tue, 15 Oct 2013 15:57:13 -0700

author
jjg
date
Tue, 15 Oct 2013 15:57:13 -0700
changeset 2134
b0c086cd4520
parent 1978
7bf6313e1ced
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8026564: import changes from type-annotations forest
Reviewed-by: jjg
Contributed-by: wdietl@gmail.com, steve.sides@oracle.com

jjg@1978 1 /*
jjg@1978 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
jjg@1978 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jjg@1978 4 *
jjg@1978 5 * This code is free software; you can redistribute it and/or modify it
jjg@1978 6 * under the terms of the GNU General Public License version 2 only, as
jjg@1978 7 * published by the Free Software Foundation.
jjg@1978 8 *
jjg@1978 9 * This code is distributed in the hope that it will be useful, but WITHOUT
jjg@1978 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jjg@1978 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jjg@1978 12 * version 2 for more details (a copy is included in the LICENSE file that
jjg@1978 13 * accompanied this code).
jjg@1978 14 *
jjg@1978 15 * You should have received a copy of the GNU General Public License version
jjg@1978 16 * 2 along with this work; if not, write to the Free Software Foundation,
jjg@1978 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jjg@1978 18 *
jjg@1978 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jjg@1978 20 * or visit www.oracle.com if you need additional information or have any
jjg@1978 21 * questions.
jjg@1978 22 */
jjg@1978 23
jjg@1978 24 /*
jjg@1978 25 * @test
jjg@1978 26 * @bug 8023768
jjg@1978 27 * @summary Type annotations on a type variable, where the bound of
jjg@1978 28 * the type variable is an annotated type variable,
jjg@1978 29 * need to be processed correctly.
jjg@1978 30 * @author Werner Dietl
jjg@1978 31 * @compile TypeVariableCycleTest.java
jjg@1978 32 */
jjg@1978 33
jjg@1978 34 import java.lang.annotation.*;
jjg@1978 35
jjg@1978 36 class TypeVariableCycleTest<CTV> {
jjg@1978 37 <MTV extends @TA CTV> MTV cast(CTV p) {
jjg@2134 38 return (@TB MTV) p;
jjg@1978 39 }
jjg@1978 40 }
jjg@1978 41
jjg@2134 42 @Target(ElementType.TYPE_USE)
jjg@1978 43 @interface TA {}
jjg@1978 44
jjg@2134 45 @Target(ElementType.TYPE_USE)
jjg@2134 46 @interface TB {}

mercurial