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

[K2] Generic inherited members have own dedicated pages #3196

Closed
vmishenev opened this issue Oct 6, 2023 · 2 comments · Fixed by #3560
Closed

[K2] Generic inherited members have own dedicated pages #3196

vmishenev opened this issue Oct 6, 2023 · 2 comments · Fixed by #3560
Assignees
Labels
bug topic: K2 Issues / PRs that are related to the K2 migration. See #2888
Milestone

Comments

@vmishenev
Copy link
Member

vmishenev commented Oct 6, 2023

Generic inherited members should lead to pages of members from a superclass.

It happens due to KT-62405.

Also, it leads to non-suppressed functions in enum: compareTo, describeConstantable, getDeclaringClass.

Details
KT-62405 results in an incorrect DRI that leads to creating a redundant page for generic inherited members.

After the fix, the following test should be added:

    @Test
    fun `generic inherited members should have correct dri`() {
        inlineModelTest(
            """
                |interface A<T> { fun x(): T }
                |interface B : A<Int> { }
                """
        ) {
            with((this / "function" / "B" / "x").cast<DFunction>()) {
                dri.classNames equals "A" 
                dri.packageName equals "function" 
                // callable ...
            }
        }
    }

__

User-facing: if B extends A and inherits a function, clicking on that function (inside B) leads to a separate page instead of to A (where it's declared).

@vmishenev vmishenev added bug upstream bug An issue that appears due to an upstream dependency bug, such as kotlin-compiler labels Oct 6, 2023
@vmishenev vmishenev added this to the K2 compiler analysis milestone Oct 6, 2023
@IgnatBeresnev IgnatBeresnev added the topic: K2 Issues / PRs that are related to the K2 migration. See #2888 label Oct 13, 2023
@IgnatBeresnev IgnatBeresnev removed this from the K2 compiler analysis milestone Oct 13, 2023
@IgnatBeresnev IgnatBeresnev added this to the Dokka 1.9.20 milestone Oct 13, 2023
@atyrin
Copy link
Contributor

atyrin commented Nov 13, 2023

One more side effect: There are visible "obvious functions" compareTo, describeConstable and getDeclaringClass on enum pages. It should be gone in the default configuration (suppressObviousFunctions =true) after the fix.

@whyoleg
Copy link
Collaborator

whyoleg commented Nov 17, 2023

In scope of #3349 there was added test which fails because of appearing of getDeclaringClass. Test is located in ObviousAndInheritedFunctionsDocumentableFilterTest in the end of file called should not suppress toString, equals and hashcode of kotlin Enum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug topic: K2 Issues / PRs that are related to the K2 migration. See #2888
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants