Files
kotlin-fork/compiler/testData/diagnostics/tests/annotations/cycleInParameters_after.kt
T
Dmitriy Novozhilov e9ac24dc33 [FE 1.0] Report errors on cycles in annotation parameter types
^KT-47932
^KT-50753 Fixed
2022-01-14 14:26:52 +03:00

16 lines
627 B
Kotlin
Vendored

// WITH_REFLECT
// LANGUAGE: +ProhibitCyclesInAnnotations
// ISSUE: KT-47932
import kotlin.reflect.KClass
annotation class X(<!CYCLE_IN_ANNOTATION_PARAMETER_ERROR!>val value: X<!>) // error
annotation class Y(<!CYCLE_IN_ANNOTATION_PARAMETER_ERROR!>val value: Array<Y><!>) // error
annotation class Z1(<!CYCLE_IN_ANNOTATION_PARAMETER_ERROR!>val a: Z2<!>, <!CYCLE_IN_ANNOTATION_PARAMETER_ERROR!>val b: Z2<!>) // error
annotation class Z2(<!CYCLE_IN_ANNOTATION_PARAMETER_ERROR!>val value: Z1<!>) // error
annotation class A(val x: KClass<A>) // OK
annotation class B(val x: KClass<B>) // OK
annotation class C(val b: B) // OK