I have the following:
case class Location(name: String, level: Location.Level)
object Location {
trait Level
case object City extends Level
case object State extends Level
}
If I try and access City
(from another source file), I get an error saying something like
found : model.Location.City.type
required: model.Level
I can think of some work-arounds, but I'm wondering if there's a way to keep my names the same i.e. I'd like to access City
by typing Location.City
.
EDIT:
I'm accessing it like this:
import the.package.name._
Location.City