Scala枚举类型不匹配

Eri*_*yen 5 enums scala-2.10

我一直在 scala 2.10.4 环境中工作,但在编码时遇到了一个奇怪的错误,如下所示:

object TestTypes extends Enumeration {
    type TestTypes = Value
    val Test,
        Blah,
        Blah2 = Value
}

def printStuff(v: TestTypes.Value) = {
    println(v)
}


val v = TestTypes(1)
printStuff(v)
Run Code Online (Sandbox Code Playgroud)

我得到的错误如下:

<console>:81: error: type mismatch;
 found   : TestTypes.Value
 required: TestTypes.Value
              printStuff(v)
                         ^
Run Code Online (Sandbox Code Playgroud)

但我真的无法弄清楚为什么会出现这个错误。我无法升级 Scala 版本(尽管我已经检查过并且此代码适用于 2.11.7)。有没有人知道为什么会发生这个错误,或者如果有办法解决它会更好吗?