When compiling the code
import scala.scalajs.js
import org.scalajs.dom.MouseEvent
@js.native
trait MyElement extends js.Object :
var onclick: js.Function1[MouseEvent, ?] = js.native
object Test :
def handleInput(me: MouseEvent): Unit = ()
val input: MyElement = ???
input.onclick = handleInput _
under Scala 3.4.0 / ScalaJS it gives the deprecation warning:
The syntax `<function> _` is no longer supported;
you can simply leave out the trailing ` _`
This construct can be rewritten automatically under -rewrite -source 3.4-migration.
okay, so we need to remove the _
in the last line, but then we get:
method handleInput is eta-expanded even though scala.scalajs.js.Function1[org.scalajsĀ².dom.MouseEvent, Any]
does not have the @FunctionalInterface annotation.
where: scalajs is a package in package scala
scalajsĀ² is a package in package org
is this a āSpurious Eta expansion warningā? Something like this issue?