Skip to content

Instantly share code, notes, and snippets.

@asouza
Created March 6, 2012 14:34
Show Gist options
  • Save asouza/1986578 to your computer and use it in GitHub Desktop.
Save asouza/1986578 to your computer and use it in GitHub Desktop.
Scala 2.10 new Reflection API
import scala.reflect.api._
import scala.reflect.runtime._
import scala.reflect.runtime.Mirror._
object Pimps{
implicit def pimp(str:String) = new {
def test = println("hello")
}
}
val aType:Type = Mirror.typeOfInstance(Pimps)
val members:List[Symbol] = aType.members
val justImplicits = members.filter(member => member.hasModifier(Modifier.`implicit`))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment