mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
Migrate boxWithJava tests to multi-file framework
This commit is contained in:
19
compiler/testData/codegen/boxWithJava/annotationsWithKClass/basic.kt
vendored
Normal file
19
compiler/testData/codegen/boxWithJava/annotationsWithKClass/basic.kt
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// FILE: Test.java
|
||||
|
||||
class OK {}
|
||||
|
||||
@Ann(arg=OK.class)
|
||||
class Test {
|
||||
}
|
||||
|
||||
// FILE: basic.kt
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val arg: KClass<*>)
|
||||
|
||||
fun box(): String {
|
||||
val argName = Test::class.java.getAnnotation(Ann::class.java).arg.simpleName ?: "fail 1"
|
||||
return argName
|
||||
}
|
||||
Reference in New Issue
Block a user