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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -