Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/multifile/Annotations.kt
T
2020-05-21 18:01:36 +03:00

46 lines
1.0 KiB
Kotlin
Vendored

// FILE: annotations.kt
package annotations
@Target(AnnotationTarget.FILE, AnnotationTarget.FUNCTION, AnnotationTarget.TYPE, AnnotationTarget.PROPERTY_GETTER)
annotation class Simple
annotation class WithInt(val value: Int)
annotation class WithString(val s: String)
annotation class Complex(val wi: WithInt, val ws: WithString)
annotation class VeryComplex(val f: Float, val d: Double, val b: Boolean, val l: Long, val n: <!NULLABLE_TYPE_OF_ANNOTATION_MEMBER!>Int?<!>)
// FILE: main.kt
@file:Simple
package test
import annotations.*
@WithInt(42)
abstract class First {
@Simple
abstract fun foo(@WithString("abc") arg: @Simple Double)
@Complex(WithInt(7), WithString(""))
abstract val v: String
}
@WithString("xyz")
class Second(val y: Char) : @WithInt(0) First() {
override fun foo(arg: Double) {
}
override val v: String
@Simple get() = ""
@WithString("constructor")
constructor(): this('\n')
}
@WithInt(24)
@VeryComplex(3.14f, 6.67e-11, false, 123456789012345L, null)
typealias Third = @Simple Second