Skip to content

DottyDoc ignores precedence when pretty-printing types in RenderReference #4966

Closed
@Blaisorblade

Description

@Blaisorblade

Based on code inspection, it seems like both RenderReference and ReferenceShower (which should disappear in #4954) ignore precedence: you'd get A & B => C from both (A & B) => C and A & (B => C), and one would have have similar issues whenever combining operators with different precedence.

I confirmed this by compiling the following source (placed in dotty/doc-tool/src/dotty/tools/dottydoc/model/TestDoc.scala), running dotty-doc/genDocs, and then opening dotty/docs/_site/api/dotty/tools/dottydoc/model/TestDoc.html (search didn't find that file, somehow, not sure how I should run doc generation).

package dotty.tools.dottydoc.model

trait TestDoc {
  type A
  type B
  type C
  val f1: (A with B) => C
  val f2: A with (B => C)
}

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