Support loading Java annotations with TYPE_PARAMETER target

This commit is contained in:
Denis Zharkov
2016-03-16 15:56:25 +03:00
parent 04eb5ff4f7
commit 26081bf817
17 changed files with 125 additions and 24 deletions

View File

@@ -0,0 +1,15 @@
package test;
import java.lang.annotation.*;
public class TypeParameterAnnotations {
@Target(ElementType.TYPE_PARAMETER)
public @interface A {
String value() default "";
}
// Currently annotations on type parameters and arguments are not loaded from compiled code because of IDEA-153093
// Once it will be fixed check if KT-11454 is ready to be resolved
public interface G<@A T> {
<@A("abc") R> void foo(R r);
}
}

View File

@@ -0,0 +1,14 @@
package test
public open class TypeParameterAnnotations {
public constructor TypeParameterAnnotations()
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE_PARAMETER}) @kotlin.annotation.Retention(value = ...) public final annotation class A : kotlin.Annotation {
public final val value: kotlin.String
public final fun <get-value>(): kotlin.String
}
public interface G</*0*/ @test.TypeParameterAnnotations.A(value = "") T : kotlin.Any!> {
public abstract fun </*0*/ @test.TypeParameterAnnotations.A(value = "abc") R : kotlin.Any!> foo(/*0*/ R!): kotlin.Unit
}
}

View File

@@ -0,0 +1,14 @@
package test
public open class TypeParameterAnnotations {
public constructor TypeParameterAnnotations()
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE_PARAMETER}) public final annotation class A : kotlin.Annotation {
public constructor A(/*0*/ value: kotlin.String = ...)
public final val value: kotlin.String
}
public interface G</*0*/ T : kotlin.Any!> {
public abstract fun </*0*/ R : kotlin.Any!> foo(/*0*/ p0: R!): kotlin.Unit
}
}