Files
kotlin-fork/compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.fir.kt
T
Mikhail Glukhikh ffd77850ef K2: add proper catch parameter annotation targeting
In this commit we begin counting a catch parameter as
both a local variable and a value parameter for the purpose
of annotation targeting.

#KT-61691 Fixed
2023-09-13 11:27:14 +00:00

23 lines
534 B
Kotlin
Vendored

// WITH_STDLIB
// ISSUE: KT-61691
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.VALUE_PARAMETER)
annotation class FixCatchValueParameter
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.LOCAL_VARIABLE)
annotation class FixCatchLocalVariable
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.CLASS)
annotation class FixCatchClass
fun main() {
try {
} catch (@FixCatchLocalVariable @FixCatchValueParameter <!WRONG_ANNOTATION_TARGET!>@FixCatchClass<!> e: Throwable) {
}
}