Closed
Description
Compiler version
3.0.0
Minimized code
import scala.scalajs.js
import scala.scalajs.js.annotation.*
object A {
@js.native
trait Bag extends js.Any {
val str: String
}
trait NonNativeBagHolderTrait(val bag: Bag) extends js.Any // error
}
Output
-- Error: tests/neg-scalajs/js-native-exports.scala:11:36 --------------------------------------------------------------
11 | trait NonNativeBagHolderTrait(val bag: Bag) extends js.Any // error
^^^^^^^^^^^^
Members of non-native JS traits must either be abstract, or their right-hand-side must be `js.undefined`.
Expectation
no error, like if val bag: Bag
is moved from trait params to the body