Skip to content

Commit 32fb1b1

Browse files
committed
Make the deprecation a warning
1 parent 388f02a commit 32fb1b1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/common/src/DateTimePeriod.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ public fun Duration.toDateTimePeriod(): DateTimePeriod = buildDateTimePeriod(tot
579579
*/
580580
@Deprecated(
581581
"Adding periods is not a well-defined operation. See https://github.com/Kotlin/kotlinx-datetime/issues/381",
582-
level = DeprecationLevel.ERROR
582+
level = DeprecationLevel.WARNING
583583
)
584584
public operator fun DateTimePeriod.plus(other: DateTimePeriod): DateTimePeriod = buildDateTimePeriod(
585585
safeAdd(totalMonths, other.totalMonths),
@@ -597,7 +597,7 @@ public operator fun DateTimePeriod.plus(other: DateTimePeriod): DateTimePeriod =
597597
*/
598598
@Deprecated(
599599
"Adding periods is not a well-defined operation. See https://github.com/Kotlin/kotlinx-datetime/issues/381",
600-
level = DeprecationLevel.ERROR
600+
level = DeprecationLevel.WARNING
601601
)
602602
public operator fun DatePeriod.plus(other: DatePeriod): DatePeriod = DatePeriod(
603603
safeAdd(totalMonths, other.totalMonths),

core/common/test/DateTimePeriodTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class DateTimePeriodTest {
144144

145145
val dp1 = DatePeriod(years = 1, months = 6)
146146

147-
@Suppress("DEPRECATION_ERROR")
147+
@Suppress("DEPRECATION")
148148
run {
149149
assertEquals(DateTimePeriod(years = 10, days = 3, hours = 2), p1 + p2 + p3)
150150
assertEquals(DatePeriod(years = 11, months = 6), dp1 + p1)

0 commit comments

Comments
 (0)