Cleanup obsolete RequireKotlin annotations
They were used to prevent older compiler versions from using specific API, but now these versions are even older than the first compiler version (namely 1.6) that can read this stdlib.
This commit is contained in:
@@ -18,7 +18,6 @@ import kotlin.internal.*
|
||||
* @return the result of [block] function invoked on this resource.
|
||||
*/
|
||||
@InlineOnly
|
||||
@RequireKotlin("1.2", versionKind = RequireKotlinVersionKind.COMPILER_VERSION, message = "Requires newer compiler version to be inlined correctly.")
|
||||
public inline fun <T : Closeable?, R> T.use(block: (T) -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
@@ -227,6 +227,5 @@ public fun File.readLines(charset: Charset = Charsets.UTF_8): List<String> {
|
||||
* @param charset character set to use. By default uses UTF-8 charset.
|
||||
* @return the value returned by [block].
|
||||
*/
|
||||
@RequireKotlin("1.2", versionKind = RequireKotlinVersionKind.COMPILER_VERSION, message = "Requires newer compiler version to be inlined correctly.")
|
||||
public inline fun <T> File.useLines(charset: Charset = Charsets.UTF_8, block: (Sequence<String>) -> T): T =
|
||||
bufferedReader(charset).use { block(it.lineSequence()) }
|
||||
|
||||
@@ -48,7 +48,6 @@ public fun Reader.readLines(): List<String> {
|
||||
* the processing is complete.
|
||||
* @return the value returned by [block].
|
||||
*/
|
||||
@RequireKotlin("1.2", versionKind = RequireKotlinVersionKind.COMPILER_VERSION, message = "Requires newer compiler version to be inlined correctly.")
|
||||
public inline fun <T> Reader.useLines(block: (Sequence<String>) -> T): T =
|
||||
buffered().use { block(it.lineSequence()) }
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import kotlin.internal.RequireKotlinVersionKind
|
||||
* @[JvmDefault] methods are excluded from interface delegation.
|
||||
*/
|
||||
@SinceKotlin("1.2")
|
||||
@RequireKotlin("1.2.40", versionKind = RequireKotlinVersionKind.COMPILER_VERSION)
|
||||
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
|
||||
@Deprecated("Switch to new -Xjvm-default modes: `all` or `all-compatibility`")
|
||||
annotation class JvmDefault
|
||||
@@ -45,7 +44,6 @@ annotation class JvmDefault
|
||||
* Used only with `-Xjvm-default=compatibility|all-compatibility`.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@RequireKotlin("1.4", versionKind = RequireKotlinVersionKind.COMPILER_VERSION)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
annotation class JvmDefaultWithoutCompatibility
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ import kotlin.reflect.KClass
|
||||
@Target(ANNOTATION_CLASS)
|
||||
@Retention(BINARY)
|
||||
@SinceKotlin("1.2")
|
||||
@RequireKotlin("1.2.50", versionKind = RequireKotlinVersionKind.COMPILER_VERSION)
|
||||
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.6")
|
||||
@Deprecated("Please use RequiresOptIn instead.")
|
||||
public annotation class Experimental(val level: Level = Level.ERROR) {
|
||||
@@ -51,7 +50,6 @@ public annotation class Experimental(val level: Level = Level.ERROR) {
|
||||
)
|
||||
@Retention(SOURCE)
|
||||
@SinceKotlin("1.2")
|
||||
@RequireKotlin("1.2.50", versionKind = RequireKotlinVersionKind.COMPILER_VERSION)
|
||||
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.6")
|
||||
@Deprecated("Please use OptIn instead.", ReplaceWith("OptIn(*markerClass)", "kotlin.OptIn"))
|
||||
public annotation class UseExperimental(
|
||||
|
||||
@@ -32,7 +32,6 @@ import kotlin.internal.RequireKotlinVersionKind
|
||||
TYPEALIAS
|
||||
)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
@RequireKotlin("1.2.50", versionKind = RequireKotlinVersionKind.COMPILER_VERSION)
|
||||
public annotation class ExperimentalMultiplatform
|
||||
|
||||
/**
|
||||
@@ -48,5 +47,4 @@ public annotation class ExperimentalMultiplatform
|
||||
@Target(ANNOTATION_CLASS)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
@ExperimentalMultiplatform
|
||||
@RequireKotlin("1.2.50", versionKind = RequireKotlinVersionKind.COMPILER_VERSION)
|
||||
public annotation class OptionalExpectation
|
||||
|
||||
@@ -26,7 +26,6 @@ import kotlin.reflect.KClass
|
||||
@Target(ANNOTATION_CLASS)
|
||||
@Retention(BINARY)
|
||||
@SinceKotlin("1.3")
|
||||
@RequireKotlin("1.3.70", versionKind = RequireKotlinVersionKind.COMPILER_VERSION)
|
||||
public annotation class RequiresOptIn(
|
||||
val message: String = "",
|
||||
val level: Level = Level.ERROR
|
||||
@@ -53,7 +52,6 @@ public annotation class RequiresOptIn(
|
||||
)
|
||||
@Retention(SOURCE)
|
||||
@SinceKotlin("1.3")
|
||||
@RequireKotlin("1.3.70", versionKind = RequireKotlinVersionKind.COMPILER_VERSION)
|
||||
public annotation class OptIn(
|
||||
vararg val markerClass: KClass<out Annotation>
|
||||
)
|
||||
|
||||
@@ -10,5 +10,4 @@ import kotlin.internal.RequireKotlinVersionKind
|
||||
@kotlin.internal.InlineOnly
|
||||
@SinceKotlin("1.2")
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@RequireKotlin("1.2.30", level = DeprecationLevel.HIDDEN, versionKind = RequireKotlinVersionKind.COMPILER_VERSION)
|
||||
public inline fun <R> suspend(noinline block: suspend () -> R): suspend () -> R = block
|
||||
|
||||
@@ -23,5 +23,4 @@ import kotlin.internal.RequireKotlinVersionKind
|
||||
@MustBeDocumented
|
||||
@Target(CLASS, ANNOTATION_CLASS, PROPERTY, FIELD, LOCAL_VARIABLE, VALUE_PARAMETER, CONSTRUCTOR, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, TYPEALIAS)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
@RequireKotlin("1.2.50", versionKind = RequireKotlinVersionKind.COMPILER_VERSION)
|
||||
public annotation class ExperimentalUnsignedTypes
|
||||
|
||||
Reference in New Issue
Block a user