Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationTargetResolvedAmbiguously.fir.kt
T
Dmitriy Novozhilov 56221467ff [FIR] Rename PLUGIN_ANNOTATION_AMBIGUITY to COMPILER_REQUIRED_ANNOTATION_AMBIGUITY
This diagnostic may be reported even without any compiler plugins (e.g.
  for annotation named `Target` or `Deprecated`), so the old name
  and message were quite confusing

^KT-64654
2024-01-03 08:50:20 +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() {
@<!COMPILER_REQUIRED_ANNOTATION_AMBIGUITY!>Target<!>(<!ARGUMENT_TYPE_MISMATCH!>AnnotationTarget.<!AMBIGUOUS_ANNOTATION_ARGUMENT!>TYPE<!><!>)
annotation class Ann
fun foo(x: <!WRONG_ANNOTATION_TARGET!>@Ann<!> String) {}
}