Files
kotlin-fork/compiler/testData/diagnostics/tests/annotations/ConstructorCallAllowed.kt
T
2021-07-21 18:24:07 +03:00

19 lines
377 B
Kotlin
Vendored

// WITH_RUNTIME
// SKIP_TXT
// !LANGUAGE: +InstantiationOfAnnotationClasses
import kotlin.reflect.KClass
annotation class A
annotation class B(val int: Int)
annotation class C(val int: Int = 42)
annotation class G<T: Any>(val int: KClass<T>)
fun box() {
val a = A()
val b = B(4)
val c = C()
val foo = <!ANNOTATION_CLASS_CONSTRUCTOR_CALL!>G(Int::class)<!>
}