Closed
Description
import scala.quoted._
import scala.reflect.ClassTag
object Arrays {
implicit def ArrayIsLiftable[T: Liftable](implicit t: Type[T], ct: Expr[ClassTag[T]]): Liftable[Array[T]] = (arr: Array[T]) => '{
new Array[~t](~(arr.length: Expr[Int]))(~ct)
// TODO add elements
}
}
fails with
assertion failed: unresolved symbols: value t when pickling Foo.scala
at scala.Predef$.assert(Predef.scala:219)
at dotty.tools.dotc.core.tasty.TreePickler.pickle(TreePickler.scala:635)
at dotty.tools.dotc.core.quoted.PickledQuotes$.pickle(PickledQuotes.scala:74)
at dotty.tools.dotc.core.quoted.PickledQuotes$.pickleQuote(PickledQuotes.scala:24)
at dotty.tools.dotc.transform.ReifyQuotes$Reifier.quotation(ReifyQuotes.scala:272)
at dotty.tools.dotc.transform.ReifyQuotes$Reifier.$anonfun$transform$3(ReifyQuotes.scala:320)
when trying to pickle the quote
dotty.runtime.Arrays.newGenericArray[t.unary_~]([[0| ]])([[1| ]])
Note that there should be a hole in place of t.unary_~
.