-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Compiler crash with recursive type matches and quotes #6281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From @biboudis minimization I minimized it further to import scala.quoted._
object Test {
val toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
implied for scala.quoted.Toolbox = toolbox
sealed trait HList
sealed trait HNil extends HList
sealed trait ::[E, T <: HList] extends HList
type Stm[A, L <: HList] = L match {
case HNil => A
case e :: rs => (A => Stm[e, rs]) => Stm[e, rs]
}
def main(args: Array[String]): Unit = {
val boom = '{ (x: Int) => (??? : Stm[Int, Int :: Int :: HNil]) }
val foo: Expr[Int] =
'{ println(); ${
boom('{4})('{ (a4: Int) => (k4: Int => Int) => ${ 'k4('a4) } } )('{ (a7: Int) => a7 })
} }
println(foo.show)
}
}
|
Great! Thanks for looking at the issue |
Even after merging #6322 this issue still occurs, so I guess it was not the reason for it. |
@b-studios it looks like it is fixed now. I added the full code that is in the first snippet in #6840 and all seemed to work. |
liufengyun
added a commit
that referenced
this issue
Jul 11, 2019
Fix #6281: Add full regression test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When generating code that uses matchers to compute types, the code compiles, but running it results in the runtime error:
Here is the full example code (sorry for not being able to minimize further):
On the example: Both
STM
andStm
are matchers that given a list of types (HList
) compute a new type. The resulting type is produced by iterating CPS.The text was updated successfully, but these errors were encountered: