Files
kotlin-fork/compiler/testData/diagnostics/tests/annotations/DeprecationOnAny.kt
T
Alejandro Serrano Mena b9b15cba08 [K2] Warn about deprecation and opt-in markers for overrides of Any
^KT-62620 Fixed

Include opt-in markers in the diagnostics
2023-10-18 12:34:58 +00:00

30 lines
620 B
Kotlin
Vendored

annotation class Other
@RequiresOptIn(message = "This is a test.")
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.FUNCTION)
annotation class OptInMarker
class A {
@Other
@Deprecated("equals")
@SinceKotlin("1.2")
override fun equals(other: Any?): Boolean {
return super.equals(other)
}
@SinceKotlin("1.3")
override fun hashCode(): Int {
return super.hashCode()
}
@Deprecated("toString")
@OptInMarker
override fun toString(): String {
return super.toString()
}
@Deprecated("other")
@OptInMarker
fun test(): Int = 5
}