Skip to content

Instantly share code, notes, and snippets.

@retronym
Created July 4, 2014 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save retronym/965a237a9d2b3f6f9585 to your computer and use it in GitHub Desktop.
Save retronym/965a237a9d2b3f6f9585 to your computer and use it in GitHub Desktop.
abstract types to lower bounds
scala> trait T[A >: Null <: String] { type M = List[A] }
defined trait T
scala> val listA = symbolOf[T[_]].info.member(TypeName("M")).info
listA: $r.intp.global.Type = List[A]
scala> listA.map(tp => if (tp.typeSymbol.isAbstract) tp.bounds.lo else tp)
res12: $r.intp.global.Type = List[Null]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment