Skip to content

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

@vmishenev

Description

@vmishenev

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).

Metadata

Metadata

Assignees

Labels

bugtopic: K2Issues / PRs that are related to the K2 migration. See #2888

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions