Introduce DeprecatedSinceKotlin annotation

This annotation will be used in the standard library to prevent the new
compiler from reporting deprecation diagnostics in case an older API
version is used (where the declaration was not deprecated yet).

 #KT-23575 Fixed
This commit is contained in:
Alexander Udalov
2018-09-07 16:24:06 +03:00
committed by Mikhail Zarechenskiy
parent b2022144e6
commit 0aaf29c045
21 changed files with 435 additions and 38 deletions
@@ -0,0 +1,29 @@
// !API_VERSION: 1.3
@DeprecatedSinceKotlin("", errorSince = "1.3")
class ClassCur
@DeprecatedSinceKotlin("", errorSince = "1.3")
fun funCur() {}
@DeprecatedSinceKotlin("", errorSince = "1.3")
val valCur = Unit
@DeprecatedSinceKotlin("", errorSince = "1.4")
class ClassNext
@DeprecatedSinceKotlin("", errorSince = "1.4")
fun funNext() {}
@DeprecatedSinceKotlin("", errorSince = "1.4")
val valNext = Unit
fun usage() {
<!DEPRECATION_ERROR!>ClassCur<!>()
<!DEPRECATION_ERROR!>funCur<!>()
<!DEPRECATION_ERROR!>valCur<!>
ClassNext()
funNext()
valNext
}