Using scalajs-jquery 0.8.0, under the following import assumptions:
import org.scalajs.jquery.{jQuery => $`, the following does not compile:
import dom.html.Element
The following code does not compile, which is my problem:
$("").hover(((_this: Element, event: JQueryEventObject) => { }): js.ThisFunction)
type mismatch;
found : scala.scalajs.js.ThisFunction
required: scala.scalajs.js.Function1[org.scalajs.jquery.JQueryEventObject,scala.scalajs.js.Any]
But the following does compile.
$("").click(((_this: Element, event: JQueryEventObject) => {
}): js.ThisFunction)
Since the methods click and hover have the same signature (and hence same implicits should apply), why does the first call not compile but the second call does? See JQuery.scala
Edit: Workaround: A workaround I found is to explicitely cast the function, so:
$("").hover((((_this: Element, event: JQueryEventObject) => { }): js.ThisFunction).asInstanceOf[js.Function1[org.scalajs.jquery.JQueryEventObject,scala.scalajs.js.Any]])