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
Post a Comment