How does one “override” an inner class in Scala?
问题 In the Scaladoc of class Enumeration#Val, I can read: "A class implementing the Value type. This class can be overridden to change the enumeration's naming and integer identification behaviour." I am puzzled: how do I override a class? Things like override class Val extends super.Val are not permitted. 回答1: There are no virtual classes in Scala (yet), so you can't write override class Val ... , and then be sure that invoking new Val will dynamically choose the right class for the new instance