Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could this be a Scala compiler bug?

I was playing around with Scala (specifically foldLeft) and came across a very weird case. Creating a val with a string inside it (I tried several strings), and then running a (admittedly bizarre?) foldLeft against it works fine for the first time but throws an assertion error the second time the exact same piece of code is run (against an immutable val). This happens consistently. Also, this happens in the console (I have not tested doing this inside an executable).

I am new to Scala, so while I don't expect this to actually be a bug, I am curious what can possibly cause this to happen?

I am running Scala 2.11.5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_31) and invoking the console by running the scala executable.

Setting up the test case:

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

Running the foldLeft once:

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!)

Running the identical foldLeft again:

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.

Any ideas?

like image 327
Ruslan Avatar asked Mar 17 '23 16:03

Ruslan


1 Answers

It was a bug in 2.11.5, namely SI-9089. It is fixed in 2.11.6.

like image 78
kiritsuku Avatar answered Mar 23 '23 06:03

kiritsuku