Files
kotlin-fork/compiler/testData/diagnostics/tests/annotations/ConstructorCallAllowed.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

20 lines
393 B
Kotlin
Vendored

// FIR_IDENTICAL
// WITH_STDLIB
// 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)<!>
}