From b1300332ee02626f756108e1150479fb991af2a3 Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Wed, 7 Sep 2022 22:50:06 +0300 Subject: [PATCH] Advance Duration.inUnits deprecation level to ERROR #KT-53864 --- libraries/stdlib/api/js-v1/kotlin.time.kt | 7 +++++++ libraries/stdlib/api/js/kotlin.time.kt | 7 +++++++ libraries/stdlib/src/kotlin/time/Duration.kt | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/libraries/stdlib/api/js-v1/kotlin.time.kt b/libraries/stdlib/api/js-v1/kotlin.time.kt index e31e35ed75b..3afabfe847b 100644 --- a/libraries/stdlib/api/js-v1/kotlin.time.kt +++ b/libraries/stdlib/api/js-v1/kotlin.time.kt @@ -214,30 +214,37 @@ public final inline class Duration : kotlin.Comparable { @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeDays property instead or convert toDouble(DAYS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.DAYS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inDays: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeHours property instead or convert toDouble(HOURS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.HOURS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inHours: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeMicroseconds property instead or convert toDouble(MICROSECONDS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.MICROSECONDS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inMicroseconds: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeMilliseconds property instead or convert toDouble(MILLISECONDS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.MILLISECONDS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inMilliseconds: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeMinutes property instead or convert toDouble(MINUTES) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.MINUTES)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inMinutes: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeNanoseconds property instead or convert toDouble(NANOSECONDS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.NANOSECONDS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inNanoseconds: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeSeconds property instead or convert toDouble(SECONDS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.SECONDS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inSeconds: kotlin.Double { get; } public final val inWholeDays: kotlin.Long { get; } diff --git a/libraries/stdlib/api/js/kotlin.time.kt b/libraries/stdlib/api/js/kotlin.time.kt index e31e35ed75b..3afabfe847b 100644 --- a/libraries/stdlib/api/js/kotlin.time.kt +++ b/libraries/stdlib/api/js/kotlin.time.kt @@ -214,30 +214,37 @@ public final inline class Duration : kotlin.Comparable { @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeDays property instead or convert toDouble(DAYS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.DAYS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inDays: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeHours property instead or convert toDouble(HOURS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.HOURS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inHours: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeMicroseconds property instead or convert toDouble(MICROSECONDS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.MICROSECONDS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inMicroseconds: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeMilliseconds property instead or convert toDouble(MILLISECONDS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.MILLISECONDS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inMilliseconds: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeMinutes property instead or convert toDouble(MINUTES) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.MINUTES)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inMinutes: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeNanoseconds property instead or convert toDouble(NANOSECONDS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.NANOSECONDS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inNanoseconds: kotlin.Double { get; } @kotlin.time.ExperimentalTime @kotlin.Deprecated(message = "Use inWholeSeconds property instead or convert toDouble(SECONDS) if a double value is required.", replaceWith = kotlin.ReplaceWith(expression = "toDouble(DurationUnit.SECONDS)", imports = {})) + @kotlin.DeprecatedSinceKotlin(errorSince = "1.8", warningSince = "1.5") public final val inSeconds: kotlin.Double { get; } public final val inWholeDays: kotlin.Long { get; } diff --git a/libraries/stdlib/src/kotlin/time/Duration.kt b/libraries/stdlib/src/kotlin/time/Duration.kt index 85543f2e8b7..e2019f96b69 100644 --- a/libraries/stdlib/src/kotlin/time/Duration.kt +++ b/libraries/stdlib/src/kotlin/time/Duration.kt @@ -794,36 +794,43 @@ public value class Duration internal constructor(private val rawValue: Long) : C /** The value of this duration expressed as a [Double] number of days. */ @ExperimentalTime @Deprecated("Use inWholeDays property instead or convert toDouble(DAYS) if a double value is required.", ReplaceWith("toDouble(DurationUnit.DAYS)")) + @DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "1.8") public val inDays: Double get() = toDouble(DurationUnit.DAYS) /** The value of this duration expressed as a [Double] number of hours. */ @ExperimentalTime @Deprecated("Use inWholeHours property instead or convert toDouble(HOURS) if a double value is required.", ReplaceWith("toDouble(DurationUnit.HOURS)")) + @DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "1.8") public val inHours: Double get() = toDouble(DurationUnit.HOURS) /** The value of this duration expressed as a [Double] number of minutes. */ @ExperimentalTime @Deprecated("Use inWholeMinutes property instead or convert toDouble(MINUTES) if a double value is required.", ReplaceWith("toDouble(DurationUnit.MINUTES)")) + @DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "1.8") public val inMinutes: Double get() = toDouble(DurationUnit.MINUTES) /** The value of this duration expressed as a [Double] number of seconds. */ @ExperimentalTime @Deprecated("Use inWholeSeconds property instead or convert toDouble(SECONDS) if a double value is required.", ReplaceWith("toDouble(DurationUnit.SECONDS)")) + @DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "1.8") public val inSeconds: Double get() = toDouble(DurationUnit.SECONDS) /** The value of this duration expressed as a [Double] number of milliseconds. */ @ExperimentalTime @Deprecated("Use inWholeMilliseconds property instead or convert toDouble(MILLISECONDS) if a double value is required.", ReplaceWith("toDouble(DurationUnit.MILLISECONDS)")) + @DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "1.8") public val inMilliseconds: Double get() = toDouble(DurationUnit.MILLISECONDS) /** The value of this duration expressed as a [Double] number of microseconds. */ @ExperimentalTime @Deprecated("Use inWholeMicroseconds property instead or convert toDouble(MICROSECONDS) if a double value is required.", ReplaceWith("toDouble(DurationUnit.MICROSECONDS)")) + @DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "1.8") public val inMicroseconds: Double get() = toDouble(DurationUnit.MICROSECONDS) /** The value of this duration expressed as a [Double] number of nanoseconds. */ @ExperimentalTime @Deprecated("Use inWholeNanoseconds property instead or convert toDouble(NANOSECONDS) if a double value is required.", ReplaceWith("toDouble(DurationUnit.NANOSECONDS)")) + @DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "1.8") public val inNanoseconds: Double get() = toDouble(DurationUnit.NANOSECONDS)