Skip to content
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

Something's going wrong with intersection types #3066

Closed
lowasser opened this issue Jul 7, 2023 · 1 comment
Closed

Something's going wrong with intersection types #3066

lowasser opened this issue Jul 7, 2023 · 1 comment
Labels

Comments

@lowasser
Copy link

lowasser commented Jul 7, 2023

On the Kotlin stdlib documentation, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm.optionals/java.util.-optional/-any.html shows

fun <T> Optional<out T>.Any()
(source)

which lacks even a shown return type.

Clicking the source leads to the admittedly convoluted line of source

public fun <T> Optional<out T & Any>.getOrDefault(defaultValue: T): T = if (isPresent) get() else defaultValue

It took me a few minutes browsing to figure out what was going on, but the getOrDefault method doesn't actually appear by name anywhere in the generated docs.

Expected behaviour
I would expect the generated Dokka to show the signature

public fun <T> Optional<out T & Any>.getOrDefault(defaultValue: T): T
@lowasser lowasser added the bug label Jul 7, 2023
@vmishenev
Copy link
Member

vmishenev commented Aug 9, 2023

Dokka supports Definitely non-nullable types since 1.7.0.
This signature would be displayed in Dokka as:
image

But https://kotlinlang.org/api/ is generated with very old Dokka.
Migration StdLib to the latest Dokka is in progress. See KT-55392

Anyway, this issue is a duplicate of KT-60968 in Kotlin Web Site.

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

No branches or pull requests

2 participants