Skip to content

@JSExport on method with variable arguments in trait behaves different from class #3538

@joschua-fink

Description

@joschua-fink

In Scala.js 0.6.26 the from JavaScript accessible method possiblyBroken throws an Exception when being called from JavaScript. A look in the compiled code shows, that it lacks the code for handling variable arguments that notBroken1 and notBroken2 have.

trait Foo {
  @JSExport def possiblyBroken(args: Int*): Unit = ???
}

class Foo2 {
  @JSExport def notBroken1(args: Int*): Unit = ???
}

@JSExportTopLevel("bar")
object Bar extends Foo2 with Foo {
  @JSExport def notBroken2(args: Int*): Unit = ???
}

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