enums - Scala Enumeration giving error -


i defining scala enum object

object logtype extends enumeration{     val value1,value2=value } 

but getting error :

object enumeration not member of package scala note: class enumeration exists, has no companion object.

what might reason?

try example scaladocs. looks have define type.

object main extends app  {    object weekday extends enumeration     {        type weekday = value        val mon, tue, wed, thu, fri, sat, sun = value    }      import weekday._    def isworkingday(d: weekday) = ! (d == sat || d == sun)    weekday.values filter isworkingday foreach println } 

Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -