-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Unresolved type symbol when pickling quotes #7008
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
Labels
Comments
More minimized version: package playground
import scala.quoted._, scala.quoted.matching._
import delegate scala.quoted._
import scala.tasty._
case class Box[T](v: T)
inline def mcr(expr: => Boolean): Unit = ${mcrProxy('expr)}
def mcrProxy(expr: Expr[Boolean]) given QuoteContext: Expr[Unit] = {
val res = mcrImpl[Boolean]('{ (esx: Box[Boolean]) => () }, expr)
// println(s"Out: ${res.show}")
res
}
def mcrImpl[T](func: Expr[Box[T] => Unit], expr: Expr[T]) given (ctx: QuoteContext, tt: Type[T]): Expr[Unit] = {
import ctx.tasty._
val x = Typed('{Box[T]($expr)}.unseal, the[quoted.Type[Box[T]]].unseal).seal.asInstanceOf[Expr[Box[T]]]
func(x)
} |
Workaround: def mcrImpl[T](func: Expr[Box[T] => Unit], expr: Expr[T]) given (ctx: QuoteContext, tt: Type[T]): Expr[Unit] = {
import ctx.tasty._
val x = Typed('{Box[T]($expr)}.unseal, the[quoted.Type[Box[T]]].unseal).seal.asInstanceOf[Expr[Box[T]]]
val res = func(x)
'{$res: Unit}
} |
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 7, 2019
liufengyun
added a commit
that referenced
this issue
Aug 12, 2019
Fix #7008: dealias temporary types in pickling types
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Macro:
Main:
Crash
If you uncomment the println statement:
It will result in:
CyclicReference Exception
The text was updated successfully, but these errors were encountered: