Skip to content

DottyDoc fails on valid overloaded constructor with js.UndefOr[_] #12215

Closed
@russwyte

Description

@russwyte

Compiler version 3.0.0-RC3

Minimized example

import scala.scalajs.js

class Foo(a: String, b: js.UndefOr[String]):
  def this(b: js.UndefOr[String]) = this("default", b)

Output

[error] -- Error: src/main/scala/Main.scala:4:41 ---------------------------------------
[error] 4 |  def this(b: js.UndefOr[String]) = this("default", b)
[error]   |                                         ^^^^^^^^^^^^^
[error]   |undefined: this # -1: TermRef(ThisType(TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,module class <root>)),module class <empty>)),class Foo)),<init>) at readTasty
[warn] one warning found
[error] one error found

Expectation

This code compiles correctly - so it seems DottyDoc should handle it correctly.

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