mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
Test for obsolete KT-3698: Static fields of primitive types and String must be compile-time constants
#KT-3698 Obsolete
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
public class JavaClass {
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface Foo {
|
||||
int value();
|
||||
}
|
||||
|
||||
@Foo(KotlinClass.FOO_INT)
|
||||
public String test() throws NoSuchMethodException {
|
||||
return KotlinClass.FOO_STRING +
|
||||
JavaClass.class.getMethod("test").getAnnotation(Foo.class).value();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user