Why isn't the following working? (Yes, I am working with 2.9.0final and turned the "-Xexperimental" option on.)
implicit def any2Dynamic(a: Any) = new Dynamic {
def applyDynamic(name: String)(args: Any*) = {
println(a + name)
}
}
"Say".hello // value hello is not a member of java.lang.String
One can argue about how meaningful this is... If this would work as expected what precedence will take place at "Say".toInt
: StringLike.toInt
or (new Dynamic {...}).applyDynamic("toInt")
?