Resolve annotations on Java constructors
Also add tests on custom annotations on fields and methods
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package test;
|
||||
|
||||
public class AnnotatedConstructor {
|
||||
public static @interface Anno {
|
||||
String value();
|
||||
}
|
||||
|
||||
@Anno("constructor")
|
||||
public AnnotatedConstructor() { }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package test
|
||||
|
||||
public open class AnnotatedConstructor {
|
||||
test.AnnotatedConstructor.Anno(value = "constructor": kotlin.String) public constructor AnnotatedConstructor()
|
||||
|
||||
public final annotation class Anno : kotlin.Annotation {
|
||||
public constructor Anno(/*0*/ value: kotlin.String)
|
||||
public abstract fun value(): kotlin.String
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package test;
|
||||
|
||||
public class AnnotatedField {
|
||||
public static @interface Anno {
|
||||
String value();
|
||||
}
|
||||
|
||||
@Anno("static")
|
||||
public static final int x = 0;
|
||||
|
||||
@Anno("member")
|
||||
public final int y = 0;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
public open class AnnotatedField {
|
||||
public constructor AnnotatedField()
|
||||
test.AnnotatedField.Anno(value = "member": kotlin.String) public final val y: kotlin.Int = 0
|
||||
|
||||
public final annotation class Anno : kotlin.Annotation {
|
||||
public constructor Anno(/*0*/ value: kotlin.String)
|
||||
public abstract fun value(): kotlin.String
|
||||
}
|
||||
|
||||
// Static members
|
||||
test.AnnotatedField.Anno(value = "static": kotlin.String) public final val x: kotlin.Int = 0
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
package test;
|
||||
|
||||
public class AnnotatedMethod {
|
||||
@Deprecated
|
||||
public static @interface Anno {
|
||||
int value();
|
||||
}
|
||||
|
||||
@Anno(42)
|
||||
public void f() { }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,10 @@ package test
|
||||
|
||||
public open class AnnotatedMethod {
|
||||
public constructor AnnotatedMethod()
|
||||
kotlin.deprecated(value = "Deprecated in Java": kotlin.String) public open fun f(): kotlin.Unit
|
||||
test.AnnotatedMethod.Anno(value = 42: kotlin.Int) public open fun f(): kotlin.Unit
|
||||
|
||||
public final annotation class Anno : kotlin.Annotation {
|
||||
public constructor Anno(/*0*/ value: kotlin.Int)
|
||||
public abstract fun value(): kotlin.Int
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package test;
|
||||
|
||||
import java.lang.String;
|
||||
import java.util.List;
|
||||
|
||||
public class AnnotatedValueParameter {
|
||||
public static @interface Anno {
|
||||
String value();
|
||||
}
|
||||
|
||||
public void f(@Anno("non-empty") List<String> parameter) { }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
public open class AnnotatedValueParameter {
|
||||
public constructor AnnotatedValueParameter()
|
||||
public open fun f(/*0*/ test.AnnotatedValueParameter.Anno(value = "non-empty": kotlin.String) p0: kotlin.(Mutable)List<kotlin.String!>!): kotlin.Unit
|
||||
|
||||
public final annotation class Anno : kotlin.Annotation {
|
||||
public constructor Anno(/*0*/ value: kotlin.String)
|
||||
public abstract fun value(): kotlin.String
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user