这可能是Scala编译器错误吗?

时间:2015-03-23 08:20:42

标签: scala compiler-errors scala-2.11

我正在玩Scala(特别是foldLeft)并遇到了一个非常奇怪的案例。创建一个val里面有一个字符串(我尝试了几个字符串),然后运行一个(不可否认奇怪的?)foldLeft反对它第一次正常工作但第二次抛出一个断言错误运行完全相同的代码片段(针对不可变的val)。这种情况持续发生此外,这发生在控制台(我还没有测试过在可执行文件中执行此操作)。

我是Scala的新手,所以虽然我不认为这实际上是一个错误,但我很好奇是什么可能导致这种情况发生?

我正在运行Scala 2.11.5(Java HotSpot(TM)64位服务器VM,Java 1.8.0_31)并通过运行scala可执行文件来调用控制台。

设置测试用例:

scala> val t = "My test string!"
t: String = My test string!

运行foldLeft一次:

scala> t.foldLeft((0 -> ""))((x, y) => { println(f"x: $x / $x, y: $y"); (x._1 + 1 -> (x._2 + y.toString)) })
x: (0,) / (0,), y: M
x: (1,M) / (1,M), y: y
x: (2,My) / (2,My), y:  
x: (3,My ) / (3,My ), y: t
x: (4,My t) / (4,My t), y: e
x: (5,My te) / (5,My te), y: s
x: (6,My tes) / (6,My tes), y: t
x: (7,My test) / (7,My test), y:  
x: (8,My test ) / (8,My test ), y: s
x: (9,My test s) / (9,My test s), y: t
x: (10,My test st) / (10,My test st), y: r
x: (11,My test str) / (11,My test str), y: i
x: (12,My test stri) / (12,My test stri), y: n
x: (13,My test strin) / (13,My test strin), y: g
x: (14,My test string) / (14,My test string), y: !
res0: (Int, String) = (15,My test string!)

再次运行相同的 foldLeft

scala> t.foldLeft((0 -> ""))((x, y) => { println(f"x: $x / $x, y: $y"); (x._1 + 1 -> (x._2 + y.toString)) })
java.lang.AssertionError: assertion failed: List(value _1$mcI$sp, value _1$mcI$sp, value _1$mcI$sp)
    at scala.reflect.internal.Symbols$Symbol.suchThat(Symbols.scala:1916)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.matchingSymbolInPrefix$1(SpecializeTypes.scala:1460)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transformSelect$1(SpecializeTypes.scala:1483)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1579)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1347)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transformSelect$1(SpecializeTypes.scala:1467)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1579)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1347)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
    at scala.collection.immutable.List.loop$1(List.scala:173)
    at scala.collection.immutable.List.mapConserve(List.scala:189)
    at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1347)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transformSelect$1(SpecializeTypes.scala:1467)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1579)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1372)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1347)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1366)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.internal.Trees$$anonfun$itransform$2.apply(Trees.scala:1363)
    at scala.reflect.internal.Trees$$anonfun$itransform$2.apply(Trees.scala:1361)
    at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:25)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:17)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1360)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1692)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
    at scala.collection.immutable.List.loop$1(List.scala:173)
    at scala.collection.immutable.List.mapConserve(List.scala:189)
    at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
    at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transformTemplate$1(SpecializeTypes.scala:1599)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1601)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:2563)
    at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1408)
    at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1407)
    at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:25)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:17)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1406)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2589)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2587)
    at scala.collection.immutable.List.loop$1(List.scala:173)
    at scala.collection.immutable.List.mapConserve(List.scala:189)
    at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:2587)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1366)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
    at scala.collection.immutable.List.loop$1(List.scala:173)
    at scala.collection.immutable.List.mapConserve(List.scala:189)
    at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1347)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.internal.Trees$$anonfun$itransform$1.apply(Trees.scala:1357)
    at scala.reflect.internal.Trees$$anonfun$itransform$1.apply(Trees.scala:1356)
    at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:25)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:17)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1355)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
    at scala.collection.immutable.List.loop$1(List.scala:173)
    at scala.collection.immutable.List.mapConserve(List.scala:189)
    at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
    at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transformTemplate$1(SpecializeTypes.scala:1599)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1601)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:2563)
    at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1408)
    at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1407)
    at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:25)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:17)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1406)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
    at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
    at scala.collection.immutable.List.loop$1(List.scala:173)
    at scala.collection.immutable.List.mapConserve(List.scala:189)
    at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transformTemplate$1$1.apply(SpecializeTypes.scala:1599)
    at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transformTemplate$1(SpecializeTypes.scala:1599)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1601)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$3.apply(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.reportError(SpecializeTypes.scala:1420)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1428)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1371)
    at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:2563)
    at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1408)
    at scala.reflect.internal.Trees$$anonfun$itransform$4.apply(Trees.scala:1407)
    at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:30)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:25)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:17)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1406)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
    at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:44)
    at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform1(SpecializeTypes.scala:1712)
... **[Trimmed due to StackOverflow character limit]** ...

That entry seems to have slain the compiler.  Shall I replay
your session? I can re-run each line except the last one.
[y/n]
Abandoning crashed session.

有什么想法吗?

1 个答案:

答案 0 :(得分:7)

这是2.11.5中的错误,即SI-9089。它在2.11.6中修复。