Closed
Description
Minimized example
import scala.quoted._
object Macro {
def impl[A : Type](using qctx: QuoteContext): Expr[A] = {
import qctx.tasty._
import util._
val tpe = typeOf[A].seal
'{ (a: ${tpe}) => ???}
'{???}
}
}
Output
[error] 9 | '{ (a: ${tpe}) => ???}
[error] | ^^^^^^
[error] | tpe.$splice cannot be used as a value type
Expectation
It should be possible to splice the type. It's also not possible to splice types which are obtained from TASTY reflect.
If we cast to Type[_ <: Any]
, the above snippet works. Because of this I suspect that the code isn't sound and I should be doing some form of check before splicing.