Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationTargetResolvedAmbiguously.fir.kt
T
Dmitrii Gridin a60777b9a7 [FIR] move annotation recheck logic to ANNOTATIONS_ARGUMENTS_MAPPING phase
ARGUMENTS_OF_ANNOTATIONS will be dropped, so this check should be moved
This commit also drops class annotations resolution from implicit type
phase and provides the correct scope during argument mapping phase.
This code was effectively unreachable before

^KT-62679
2023-10-19 14:34:35 +00:00

44 lines
1.1 KiB
Kotlin
Vendored

import kotlin.annotation.AnnotationTarget.FIELD
object Some {
@Target(<!ARGUMENT_TYPE_MISMATCH!>AnnotationTarget.<!AMBIGUOUS_ANNOTATION_ARGUMENT!>CLASS<!><!>)
annotation class Ann
enum class AnnotationTarget {
CLASS
}
@Target(<!AMBIGUOUS_ANNOTATION_ARGUMENT, ARGUMENT_TYPE_MISMATCH!>FIELD<!>)
annotation class Ann2
const val FIELD = ""
}
object SomeMore {
@Target(<!ARGUMENT_TYPE_MISMATCH!>kotlin.annotation.AnnotationTarget.<!AMBIGUOUS_ANNOTATION_ARGUMENT!>FUNCTION<!><!>)
annotation class Ann3
object kotlin {
object annotation {
enum class AnnotationTarget {
FUNCTION
}
}
}
}
abstract class Base {
annotation class Target(val target: AnnotationTarget)
enum class AnnotationTarget {
TYPE
}
}
class Derived : Base() {
@<!PLUGIN_ANNOTATION_AMBIGUITY!>Target<!>(<!ARGUMENT_TYPE_MISMATCH!>AnnotationTarget.<!AMBIGUOUS_ANNOTATION_ARGUMENT!>TYPE<!><!>)
annotation class Ann
fun foo(x: <!WRONG_ANNOTATION_TARGET!>@Ann<!> String) {}
}