dokka icon indicating copy to clipboard operation
dokka copied to clipboard

[K2] Dokka generates a redundant page

Open vmishenev opened this issue 1 year ago • 1 comments
trafficstars

Dokka generates a redundant page in the case of an untrivial hierarchy when there is an intersected and overridden fake function/property.

From Gradle DSL`s codebase:

class NamedDomainObjectContainerScope<T : Any>
   : NamedDomainObjectContainerDelegate<T>(), PolymorphicDomainObjectContainer<T>

abstract class NamedDomainObjectContainerDelegate<T : Any> : NamedDomainObjectContainer<T> {
   override fun getNamer(): T? = null
}

interface PolymorphicDomainObjectContainer<T> : NamedDomainObjectContainer<T>

interface NamedDomainObjectContainer<T> {
   fun getNamer(): T? = null
}

K1: The signature of the function NamedDomainObjectContainerScope.getNamer leads to NamedDomainObjectContainerDelegate.getNamer. It has the DRI NamedDomainObjectContainerDelegate.getNamer.

image

K2: The signature of the function NamedDomainObjectContainerScope.getNamer leads to a dedicated page NamedDomainObjectContainerScope.getNamer It has the DRI NamedDomainObjectContainerScope.getNamer. image

vmishenev avatar Oct 14 '24 08:10 vmishenev

It is blocked by https://youtrack.jetbrains.com/issue/KT-72244/Analysis-API-Fake-override-symbol-has-no-overridden-symbols

vmishenev avatar Oct 14 '24 09:10 vmishenev

It seems like the cause of the bug was on the FIR side, and it is already fixed in the current versions of Kotlin/AA.

@vmishenev The test you added works after rebasing, and the web page rendering behaves as expected. Are you OK with me updating it and opening a PR?

AbdullinAM avatar Oct 20 '25 14:10 AbdullinAM

Great! I’m totally fine.

vmishenev avatar Oct 21 '25 09:10 vmishenev

Issue is already fixed in AA, new tests added in #4307

AbdullinAM avatar Oct 28 '25 12:10 AbdullinAM