为什么我不能进行模式匹配:
class Gender extends Enumeration {
val male, female, unknown = Value
}
object MyObj {
def getGender(str: String) = str match {
case "1" => Gender.male
case "2" => Gender.female
case _ => Gender.unknown
}
}
错误not found: value Gender