Skip to content

Fix ReplaceWith on deprecated Instant.toEpochMilliseconds and isDistantFuture - #650

Merged
dkhalanskyjb merged 1 commit into
Kotlin:masterfrom
lenamonj:fix-instant-replace-with
Sep 3, 2026
Merged

dkhalanskyjb merged 1 commit into
Kotlin:masterfrom
lenamonj:fix-instant-replace-with

Conversation

@lenamonj

@lenamonj lenamonj commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Two ReplaceWith expressions on the deprecated kotlinx.datetime.Instant name a different member than the one they annotate. toEpochMilliseconds() offers this.toStdlibInstant().nanosecondsOfSecond as its replacement, in the expect declaration and both actual ones, and isDistantFuture offers this.toStdlibInstant().isDistantPast. An IDE quick-fix applied to either changes the program's result and leaves no warning behind.

This corrects the four expressions to the same-named member on kotlin.time.Instant. Annotation-only, so no test.

Found by an automated audit; the change was reviewed and verified by a person on a fresh clone with jvmTest, jsTest and wasmJsTest.

@dkhalanskyjb
dkhalanskyjb merged commit 1cdfa59 into Kotlin:master Sep 3, 2026
@lenamonj
lenamonj deleted the fix-instant-replace-with branch September 5, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants