【发布时间】:2013-09-15 15:33:26
【问题描述】:
我有一个 quoasiquote matcher where q"someMethod[$ts]()" where def someMethod[I <: shapeless.HList]()"。
打印ts 给出:
List(shapeless.HNil)
或者,例如
List(String, Int)
然后我尝试分配:
val types: List[scala.reflect.api.Types.Type] = ts
导致编译器错误:
[error] type mismatch;
[error] found : List[_125.u.Tree] where val _125: scala.reflect.api.QuasiquoteCompat.TypeAppliedExtractor{val u: OpTreeContext.this.c.universe.type}
[error] required: List[Context.this.c.universe.Type]
如何从ts 合成List[scala.reflect.api.Types.Type]?
【问题讨论】:
标签: scala scala-macros shapeless scala-quasiquotes