I have a scala.js project. There I have a strange behavior with Scala.Meta and Binding.scala.
I want to create a case class from a case class:
case class SimpleCaseClass(i: Int, s: String, list: Seq[String])
should generate to:
SimpleCaseClassFormData(Var[Int], Var[String], Vars[String])
as soon that I have a Vars
, I get the following error:
A method defined in a JavaScript raw type of a Scala.js library has been called. This is most likely because you tried to run Scala.js binaries on the JVM. Make sure you are using the JVM version of the libraries.
java.lang.Error: A method defined in a JavaScript raw type of a Scala.js library has been called. This is most likely because you tried to run Scala.js binaries on the JVM. Make sure you are using the JVM version of the libraries.
at scala.scalajs.js.package$.native(package.scala:134)
at scala.scalajs.js.Array.push(Array.scala:106)
at scala.scalajs.js.JSConverters$JSRichGenTraversableOnce$.$anonfun$toJSArray$1(JSConverters.scala:60)
Without (for example SimpleCaseClassFormData(Var[Int], Var[String])
) it works.
Here you find the whole project: scala-adapters-form
Macro annotation is deprecated (See https://github.com/scalameta/scalameta/issues/1182)
You can create an sbt plugin based on Scala Meta instead. See https://github.com/ThoughtWorksInc/sbt-example/ as an example to implement such a plugin.
To avoid incompatible versions, you should use the sbt's built-in Scala Meta, which is version 1.7.0.