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
class DynamicImpl(x: AnyRef) extends Dynamic { | |
def _select_(name: String): DynamicImpl = { | |
new DynamicImpl(x.getClass.getMethod(name).invoke(x)) | |
} | |
def _invoke_(name: String)(args: Any*) = { | |
new DynamicImpl(x.getClass.getMethod(name, args.map(_.asInstanceOf[AnyRef].getClass) : _*).invoke(x, args.map(_.asInstanceOf[AnyRef]) : _*)) | |
} | |
override def typed[T] = x.asInstanceOf[T] | |
override def toString = "Dynamic(" + x.toString + ")" | |
} |