gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 03:22:49 28 4
gpt4 key购买 nike

我正在使用 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.

有什么想法吗?

最佳答案

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

关于scala - 这可能是 Scala 编译器错误吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29205753/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com