How to get correct value type when extending Scala Enumeration.Val
问题 While there are many questions on S/O regarding difficulties with Scala Enumeration, I haven't found a question that addresses my problem. Specifically, I am trying to translate the Planet example from the Oracle Java enum docs into the Scala Enumeration idiom so as to better understand the workings and pro's & con's of the Scala form. My ported code so far appears below and, suffice to say, it does not compile as might be expected from the principle of least surprise. Apart from type casting