Skip to content

[Docs] Mark new kotlin.time types as new in 2.1.20 #5434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LlemonDuck
Copy link

The KotlinLang Docs for e.g.
Instant specify that Instant is available since Kotlin 2.1. However, it is only available from 2.1.20. The same applies for Clock.

When attempting to use these types in a Kotlin 2.1.10 project, I was left confused at the inability to import them. I eventually found the reason in the Kotlin 2.1.20 release changelog.

SinceKotlin's version field supports patch-level versions:

@property version The version in the following formats: .or..`, where major, minor and patch
are non-negative integer numbers without leading zeros.

This PR includes the patch version for the Instant, Clock, and the relevant Instant top-level functions.

The KotlinLang Docs for e.g.
[`Instant`](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-instant/)
specify that Instant is available since Kotlin 2.1.
However, it is only available from 2.1.20. The same applies for `Clock`.

When attempting to use these types in a Kotlin 2.1.10 project,
I was left confused at the inability to import them.
I eventually found the reason in the Kotlin 2.1.20 release changelog.

SinceKotlin's version field supports patch-level versions:
> `@property version The version in the following formats: `<major>.<minor>`
> or `<major>.<minor>.<patch>`, where major, minor and patch
> are non-negative integer numbers without leading zeros.

This PR includes the patch version for the Instant, Clock,
and the relevant Instant top-level functions.
@fzhinkin
Copy link
Contributor

Note that this change affects not only generated docs, but also how the compiler filters out available declarations depending on the -api-version option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants