scala / scala3

The Scala 3 compiler, also known as Dotty.
https://dotty.epfl.ch
Apache License 2.0
5.81k stars 1.05k forks source link

ScalaDoc shows wrong type for this.type #16024

Closed odersky closed 1 year ago

odersky commented 2 years ago

Compiler version

3.2.1 RC-1

Minimized example

In Tuple.scala:

  inline def map[F[_]](f: [t] => t => F[t]): Map[this.type, F] =
    runtime.Tuples.map(this, f).asInstanceOf[Map[this.type, F]]

Output

Scaladoc output:

def map[F[_]](f: [t] => (x$1: t) => F[t]): Map[Tuple, F]

Expectation

this.type should be rendered as this.type, not Tuple. The two have very different meanings. I am not sure whether other singleton types are rendered correctly, we should check that as well.

som-snytt commented 2 years ago

This rings a bell https://github.com/lampepfl/dotty/issues/15426 which is deemed fixed in June. Nightly docs shows that was fixed but not this report.