[FE 1.0] Report errors on cycles in annotation parameter types

^KT-47932
^KT-50753 Fixed
This commit is contained in:
Dmitriy Novozhilov
2022-01-12 13:12:31 +03:00
committed by teamcity
parent 139a800ff7
commit e9ac24dc33
16 changed files with 322 additions and 0 deletions
@@ -0,0 +1,15 @@
// WITH_REFLECT
// LANGUAGE: -ProhibitCyclesInAnnotations
// ISSUE: KT-47932
import kotlin.reflect.KClass
annotation class X(<!CYCLE_IN_ANNOTATION_PARAMETER_WARNING!>val value: X<!>) // error
annotation class Y(<!CYCLE_IN_ANNOTATION_PARAMETER_WARNING!>val value: Array<Y><!>) // error
annotation class Z1(<!CYCLE_IN_ANNOTATION_PARAMETER_WARNING!>val a: Z2<!>, <!CYCLE_IN_ANNOTATION_PARAMETER_WARNING!>val b: Z2<!>) // error
annotation class Z2(<!CYCLE_IN_ANNOTATION_PARAMETER_WARNING!>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