Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upfastOptJS error in scalaz 7.3 with Scala.js 1.0.0 #3953
Comments
xuwei-k
commented
Feb 8, 2020
|
Thanks for the report. I will look into it once we're through with all the release steps. Since the IR error is in the tests, it probably means that the main artifacts, to be published, are correct. You could comment out the problematic test, and if things pass, then you can safely publish the main artifacts, I believe. |
It would help us fix the issue if you manage to provide a minimization. |
package example
sealed class StreamT[M[_], A](val step: M[StreamT.Step[A, StreamT[M, A]]])
object StreamT {
sealed abstract class Step[A, S] extends Product with Serializable
case class Done[A, S]() extends Step[A, S]
}
object Main {
import StreamT._
implicit class AnyOps[A](actual: => A) {
def mustMatch(f: PartialFunction[A, Boolean]): Unit = {
val act = actual
def test = f.isDefinedAt(act) && f(act)
def koMessage = "%s does not satisfy partial function".format(act)
if (!test)
sys.error(koMessage)
}
}
type Id[A] = A
def x[A](s: StreamT[Id, A]) = s.step mustMatch {
case Done() => true
}
def main(args: Array[String]): Unit = {
println(x(null))
}
} |
Further reduction: package example
import scala.language.higherKinds
sealed class StreamT[M[_]](val step: M[Step[StreamT[M]]])
sealed abstract class Step[S]
object Main {
implicit class AnyOps[A](actual: A) {
def mustMatch(f: PartialFunction[A, Boolean]): Unit = ()
}
type Id[A] = A
def main(args: Array[String]): Unit = {
(??? : StreamT[Id]).step mustMatch {
case _ => true
}
}
} Notably: The implicit conversion and the type function seem to be required to reproduce. |
So it seems the problem is that we take the param symbols from different locations:
This is (for now), the only difference I can see between the ways we retrieve the types :-/ Both |
@gzm0 you are right. However, this seems to be an issue in |
… aliases The issue occurs due to a bug in scalac, where Defdef vparamss and the respective symbol have inconsistent types. For more information, please see: scala/bug#11884
The issue occurs due to a bug in scalac, where Defdef vparamss and the respective symbol have inconsistent types. For more information, please see: scala/bug#11884
Just to confirm my understanding (w.r.t. scala/bug#11884 (comment)): The reason we need all this uglyness and patching (and cannot simply use |
I don't know about "wrong", but I would say that "inconsistent" is a more accurate word. The Plus, the easiest way to do this is to patch the IR Tree after it has been generated, in order to avoid touching the generation process itself, which would probably introduce far more code changes. |
PR in scala/scala: scala/scala#8720 |