Why does my Scala enumeration not work?
I have the following Enumeration
class Market extends Enumeration {
type Market = Value
val A开发者_StackOverflow中文版SX = Value("ASX")
val LSE = Value("LSE")
}
In the same package but a different class I'm trying
if (Market.ASX = ...)
And I am getting a compile error not found: value Market
It should be an object
.
object Market extends Enumeration {
type Market = Value
val ASX = Value("ASX")
val LSE = Value("LSE")
}
精彩评论