I have the following Scala enum which I designed after reading this answer:
object RunMode extends Enumeration {
val CLIENT_MODE = Value("CLIENT_MODE")
val SERVER_MODE = Value("SERVER_MODE")
}
I am now trying to pass an instance of it as an argument into the constructor of another class:
package com.me.myapp.shared.config
import com.me.myapp.shared.utils.RunMode
class MyAppConfig(runMode : RunMode) {
}
This gives me a compiler error:
Cannot resolve symbol
RunMode
BTW: com.me.myapp.shared.utils.RunMode
is the correct package path for RunMode
, so that's not the issue here!
I assume that this is maybe because there is only (ever) one single instance of the RunMode
object, and perhaps that prevents it from being passed in as an arg.
Either way, I don't really care what the solution is. But I need an "enum" called RunMode
and I'll need to be able to pass instances of it into contructors of other classes. Any ideas?