Skip to content

Wrong type shown on hover on method with this.type as param bound #4675

Open
@Florian3k

Description

@Florian3k

Describe the bug

Write the following code:

val z: Tuple = ???
def m(x: Tuple) = x.zip(z)

Hover on zip
It shows:
image

Symbol signature:
inline def zip[This >: Tuple <: Tuple, T2 <: Tuple](t2: T2): Zip[This, T2]

Expected behavior

Expected signature:
inline def zip[This >: this.type <: Tuple, T2 <: Tuple](t2: T2): Zip[This, T2]
Source: https://github.com/lampepfl/dotty/blob/main/library/src/scala/Tuple.scala#L51

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

0.11.9

Scala version

3.2.0

Extra context or search terms

This problem also occurs in other methods with this.type as param bounds, eg:
inline def take[This >: Tuple <: Tuple](n: Int): Take[This, n.type]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that is making a piece of functionality unusablehoverpresentation-compilerSomething relating to the presentation compilerpriority:lowupstream-fix-neededWaiting on a fix upstream

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions