Skip to content

Incorrect pretty-print for right-associative extension methods #17000

Open
@Sporarum

Description

@Sporarum

Compiler version

3.2.2

Minimized code

extension [A](y: A)
  def foo_:[B](x: B) = ()

foo_:

https://scastie.scala-lang.org/TfcvRr9fQaqCMlzI9BYesA

Output

On mouse-over on foo_::

extension [A][B](y: A) def foo_:(x: B): Unit

Expectation

Should be almost identical to definition:

extension [A](y: A) def foo_:[B](x: B): Unit

Solution

Find the place which does the swap in the pretty printing logic, and fix it to conform to:
https://github.com/lampepfl/dotty/blob/5fb27667a5843c388670f1f7688b37007aa94610/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala#L898-L925

Given the above, good first issue ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions