Skip to content

Instantly share code, notes, and snippets.

@dcsobral
Created February 2, 2013 17:02
Show Gist options
  • Save dcsobral/4698304 to your computer and use it in GitHub Desktop.
Save dcsobral/4698304 to your computer and use it in GitHub Desktop.
scala> type T = List[String]
defined type alias T
scala> val tpe = implicitly[TypeTag[T]].tpe.normalize
tpe: reflect.runtime.universe.Type = List[String]
scala> val tpeSymbol = tpe.typeSymbol.asType
tpeSymbol: reflect.runtime.universe.TypeSymbol = class List
scala> val args = tpeSymbol.typeParams.map(_.asType.toTypeIn(tpe))
args: List[reflect.runtime.universe.Type] = List(String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment