Skip to content

Missing @JSName annotation warning after overriding a @ScalaJSDefined method #1983

@xsistens

Description

@xsistens

There should be at least an information that @JSName annotation has to be reapplied after overriding a method from a @ScalaJSDefined class. Best would be if the annotation is carried over, because I think it's a common pattern in @ScalaJSDefined classes to rename the scala method name from a facade to provide a custom method with the actual method name and call the renamed one.

@ScalaJSDefined
abstract class A extends js.Object {
  @JSName("_test")
  def test(): Int
  @JSName("test")
  def _test(): String = test().toString
}
val a = new A {
  override def test() = 1
}

This leads to a Conflicting properties and methods for ... Error because the @JSName annotation is not carried over.

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