开发者

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

开发者 https://www.devze.com 2022-12-22 12:54 出处:网络
This code does not compile: object Token extends Enumeration { type ID = Value val Key, Value = Value } e开发者_Python百科rror: recursive value Value needs type

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

精彩评论

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

关注公众号