Why does the following not work? (Yes, I work with 2.9.0final and have included the option "-Xexperimental".)
implicit def any2Dynamic(a: Any) = new Dynamic { def applyDynamic(name: String)(args: Any*) = { println(a + name) } } "Say".hello
You can argue about how significant it is ... If it worked, as expected, what would happen in "Say".toInt : StringLike.toInt or (new Dynamic {...}).applyDynamic("toInt") ?
scala dynamic-typing
Peter Schmitz
source share