some change for Scala 2.10

This commit is contained in:
Eugene Yokota 2017-02-15 18:52:04 -05:00
parent b6cad50327
commit a12045ed42
1 changed files with 4 additions and 4 deletions

View File

@ -18,10 +18,10 @@ object StringTypeTag {
}
def typeToString(tpe: Type): String =
tpe match {
case ref: TypeRef =>
if (ref.args.nonEmpty) {
val typeCon = ref.typeConstructor.typeSymbol.asType.fullName
val typeArgs = ref.typeArgs map typeToString
case TypeRef(_, sym, args) =>
if (args.nonEmpty) {
val typeCon = tpe.typeSymbol.fullName
val typeArgs = args map typeToString
s"""$typeCon[${typeArgs.mkString(",")}]"""
} else tpe.toString
case _ => tpe.toString