This code does not compile:
object Token extends Enumeration {
type ID = Value
val Key, Value = Value
}
e开发者_Python百科rror: recursive value Value needs type
What should be done to have 'Value' in the enumeration ?
This is not possible because Value
is already a final member of Enumeration
- the obvious suggestion is to call your field Val
instead.
精彩评论