开发者

What should be done to have 'Value' in the enumeration?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜