fthomas / refined

Refinement types for Scala
MIT License
1.69k stars 155 forks source link

scala.js: applyDynamic does not support passing a vararg parameter #558

Open bbarker opened 5 years ago

bbarker commented 5 years ago

In Scala.js (addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22"), when I try to do something like:

  import eu.timepit.refined._
  import eu.timepit.refined.api.Refined
  import eu.timepit.refined.auto._
  import eu.timepit.refined.numeric._

  type WidthRange = Int Refined Interval.Closed[W.`200`.T, W.`1000`.T]
  type HeightRange = Int Refined Interval.Closed[W.`200`.T, W.`1000`.T]

I get this error:

[error] /home/brandon/workspace/CCRS/web-client/src/main/scala/org/xsede/jobrunner/client/components/CCRSEditor.scala:39: applyDynamic does not support passing a vararg parameter
[error]   type WidthRange = Int Refined Interval.Closed[W.`200`.T, W.`1000`.T]
[error]                                                   ^
[error] /home/brandon/workspace/CCRS/web-client/src/main/scala/org/xsede/jobrunner/client/components/CCRSEditor.scala:39: applyDynamic does not support passing a vararg parameter
[error]   type WidthRange = Int Refined Interval.Closed[W.`200`.T, W.`1000`.T]
[error]                                                              ^
[error] /home/brandon/workspace/CCRS/web-client/src/main/scala/org/xsede/jobrunner/client/components/CCRSEditor.scala:40: applyDynamic does not support passing a vararg parameter
[error]   type HeightRange = Int Refined Interval.Closed[W.`200`.T, W.`1000`.T]
[error]                                                    ^
[error] /home/brandon/workspace/CCRS/web-client/src/main/scala/org/xsede/jobrunner/client/components/CCRSEditor.scala:40: applyDynamic does not support passing a vararg parameter
[error]   type HeightRange = Int Refined Interval.Closed[W.`200`.T, W.`1000`.T]
[error]                                                               ^

Possibly related upstream bug chain: https://github.com/scala-js/scala-js/issues/1656

fthomas commented 5 years ago

Thanks for the report, @bbarker. It is strange that this does not happen in refined's own source which is compiled for and tested with Scala.js. Which sbt command produces these errors?

fthomas commented 5 years ago

I tried reproducing this in https://github.com/fthomas/refined-sjs-example/commit/caa24a68dff36098092c5a043983667110cb0786 but this builds just fine.

It would be nice to reproduce these errors in refined-sjs-example.