1
使用TypeTag
我已经能够检索到关于我的多态类型的类型信息。获取Scala类型的类型参数
scala> paramInfo(List(1,2)).tpe
res18: reflect.runtime.universe.Type = List[Int]
现在我想检索Int.type
,但显然我无法这样做。
scala> paramInfo(List(1,2)).tpe.typeParams
res19: List[reflect.runtime.universe.Symbol] = List()
是我想做的事情,如果是这样,我该怎么做?