8000 Default arguments in the constructor of facade types fail if the companion is not a js.Any · Issue #791 · scala-js/scala-js · GitHub
[go: up one dir, main page]

Skip to content
Default arguments in the constructor of facade types fail if the companion is not a js.Any #791
Closed
@gzm0

Description

@gzm0

How to reproduce:

import scala.scalajs.js

object HelloWorld extends js.JSApp {

  def main(): Unit = {
    // Define JS class A
    js.eval("var A = function A(x) {}");

    // Instantiate
    new A(1)
  }
}

class A extends js.Object {
  def this(x: Int, y: Int = ???) = this()
}

// If you uncomment this, it works
//object A extends js.Object

Will throw a NotImplementedError coming from the ???.

Metadata

Metadata

Assignees

Labels

bugConfirmed bug. Needs to be fixed.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0