I found an example of how to implement enum
in Scala and here is what I have:
package org.myproject
object MyEnum extends Enumeration {
type MyEnum = Value
val val1, val2, val3 = Value
}
But nonetheless, I have an error type MyEnum is not a member of package org.myproject
:
package org.myproject.subnamespace
import org.myproject.MyEnum
abstract class MyClass {
def myEnum123: MyEnum
}
Notice that they are located in the slightly different packages.
UPDATE: there are 2 errors, actually, it depends on how I define def
:
package org.myproject.subnamespace
import org.myproject.MyEnum
abstract class MyClass {
def myEnum123: MyEnum // not found: type MyEnum
def myEnum123: org.myproject.MyEnum // type MyEnum is not a member of package org.myproject
}
What's wrong?