Skip to content

Don't emit unused explicit parameter for ScalaJS facades #17240

Closed
@rochala

Description

@rochala

Compiler version

3.3.1-RC1-bin-20230411-d577300-NIGHTLY

Minimized code

ScalaJS allows interoperability with Javascript by creating the facades. The definitions require to provide proper argument list, but the implementation never uses them and is always a call to js.native

@js.native
@JSImport("paper", "Rectangle")
class Rectangle() extends js.Object {
  def this(x1: Double, y1: Double, x2: Double, y2: Double) = this()
}

Output

@js.native
@JSImport("paper", "Rectangle")
class Rectangle() extends js.Object {
  def this(x1: Double, y1: Double, x2: Double, y2: Double) = this() // unused explicit parameter
}

Expectation

Unused warning is not thrown when js.native annotation is present in scope of the tree.

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