Created
March 6, 2012 14:34
-
-
Save asouza/1986578 to your computer and use it in GitHub Desktop.
Scala 2.10 new Reflection API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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