scala - Dynamic Trait NoSuchFieldError @2.9.0RC4 -
is following bug or on purpose?
trait dyn { val d1 = new dynamic { def applydynamic(name: string)(args: any*) = "hi" } object d2 extends dynamic { def applydynamic(name: string)(args: any*) = "hey" } } trait t { self: dyn => def foo1 = d1.x def foo2 = d2.x } object t extends t dyn object dyn extends dyn t.d1.x // works dyn.d1.x // works t.foo1 // doesn't work: java.lang.nosuchfielderror: reflpoly$cache1 t.d2.x // works dyn.d2.x // works t.foo2 // works
that's instance of bug #4560
Comments
Post a Comment