Clearly, a compiler error (the compiler fails, and the REPL reports That entry seems to have slain the compiler. ). This does not indicate something is wrong with your code.
You create one instance of type AnyRef{def toInt(n: Int): Int} , so creating a singleton object, as Kyle suggests, may be the best way to get around it. Or create a named class / trait that you are pursuing that works great.
Luigi plinge
source share