Skip to content

Cannot lift List[T] to Expr[List[T]] #3820

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

Closed
nicolasstucki opened this issue Jan 13, 2018 · 1 comment
Closed

Cannot lift List[T] to Expr[List[T]] #3820

nicolasstucki opened this issue Jan 13, 2018 · 1 comment

Comments

@nicolasstucki
Copy link
Contributor

The List to quote lifter from the documentation does not work

implicit def ListIsLiftable[T: Liftable]: Liftable[List[T]] = new {
  def toExpr(xs: List[T]): Expr[List[T]] = xs match {
    case x :: xs1 => '(~implicitly[Liftable[T]].toExpr(x) :: ~toExpr(xs1))
    case Nil => '(Nil: List[T])
  }
}

fails with

[error] /Users/nicolas.stucki/GitHub/dotty/library/src/scala/quoted/Liftable.scala:32: unclosed character literal
[error]       case x :: xs1 => '(~implicitly[Liftable[T]].toExpr(x) :: ~toExpr(xs1))
[error]                        ^
[error] /Users/nicolas.stucki/GitHub/dotty/library/src/scala/quoted/Liftable.scala:33: unclosed character literal
[error]       case Nil => '(Nil: List[T])
[error]                   ^
[error] two errors found
@nicolasstucki
Copy link
Contributor Author

nicolasstucki commented Jan 14, 2018

Actually, it was a bootstrapping issue. The code works fine assuming #3823 is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant