Files
kotlin-fork/compiler/testData/diagnostics/tests/annotations/forParameterAnnotationResolve.kt
T
Evgeniy.Zhelenskiy 5258e2044d [FIR] Forbid annotations on anonymous initializers and destructuring declarations
#KT-59896


Merge-request: KT-MR-13197
Merged-by: Evgeniy Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>
2023-11-28 11:59:26 +00:00

16 lines
338 B
Kotlin
Vendored

// FIR_IDENTICAL
annotation class Ann(val x: Int)
data class A(val x: Int, val y: Int)
fun bar(): Array<A> = null!!
fun foo() {
for (@Ann(1) i in 1..100) {}
for (@Ann(2) i in 1..100) {}
for (<!WRONG_ANNOTATION_TARGET!>@Ann(3)<!> (x, @Ann(4) y) in bar()) {}
for (@<!UNRESOLVED_REFERENCE!>Err<!>() (x,y) in bar()) {}
}