tpe
방법을 사용하여 TypeTag[A]
에서 Type
을 얻을 수 있습니다. 하지만 유형 태그를 유형에서 복구 할 수 있습니까?유형에서 유형 태그 가져 오기?
import scala.reflect.runtime.{universe => ru}
import ru.{Type, TypeTag}
def forward[A](implicit tt: TypeTag[A]): Type = tt.tpe
def backward(t: Type): TypeTag[_] = ???
이유는지도에 키로 type-tags를 사용하는 API가 있기 때문입니다.하지만 어느 시점에서는 유형이있어 태그가 삭제되었습니다.
관련, 가능성이 중복 : http://stackoverflow.com/questions/11494788/how-to-create-a-typetag-manually –
API는 이제 변경 - 그래서 당신이 할 수있는 'TypeFactory' 대신에'TypeCreator' 구현체를 전달하십시오 – dk14