Closed
Description
minimized code
bin/dotc -d out -Yretain-trees -Ycheck:all tests/run/i5606.scala
Stack trace
*** error while checking tests/run/i5606.scala after phase inlinedPositions ***
exception occurred while compiling tests/run/i5606.scala
java.lang.AssertionError: assertion failed: wrong source set for if
{
Test.$[Int, String](
{
def $anonfun(a: Int): String = a.toString()
closure($anonfun)
}
)(10).==("10")
}.unary_!
then assertFail() else () # 2086 of class dotty.tools.dotc.ast.Trees$If, set to /Users/fliu/Documents/dotty/library/src/dotty/DottyPredef.scala but context had tests/run/i5606.scala while compiling tests/run/i5606.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: wrong source set for if
{
Test.$[Int, String](
{
def $anonfun(a: Int): String = a.toString()
closure($anonfun)
}
)(10).==("10")
}.unary_!
then assertFail() else () # 2086 of class dotty.tools.dotc.ast.Trees$If, set to /Users/fliu/Documents/dotty/library/src/dotty/DottyPredef.scala but context had tests/run/i5606.scala
at dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
at dotty.tools.dotc.transform.YCheckPositions$$anon$1.traverse(YCheckPositions.scala:33)
at dotty.tools.dotc.transform.YCheckPositions$$anon$1.traverse(YCheckPositions.scala:48)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1482)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1482)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.apply$$anonfun$1(Trees.scala:1368)
at scala.collection.LinearSeqOps.foldLeft(LinearSeq.scala:169)
at scala.collection.LinearSeqOps.foldLeft$(LinearSeq.scala:165)
at scala.collection.immutable.List.foldLeft(List.scala:79)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.apply(Trees.scala:1368)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1454)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1483)
at dotty.tools.dotc.transform.YCheckPositions$$anon$1.traverse(YCheckPositions.scala:50)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1482)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1482)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1452)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1483)
at dotty.tools.dotc.transform.YCheckPositions$$anon$1.traverse(YCheckPositions.scala:50)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1482)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1482)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.apply$$anonfun$1(Trees.scala:1368)
at scala.collection.LinearSeqOps.foldLeft(LinearSeq.scala:169)
at scala.collection.LinearSeqOps.foldLeft$(LinearSeq.scala:165)
at scala.collection.immutable.List.foldLeft(List.scala:79)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.apply(Trees.scala:1368)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1458)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1483)
at dotty.tools.dotc.transform.YCheckPositions$$anon$1.traverse(YCheckPositions.scala:50)
at dotty.tools.dotc.transform.YCheckPositions.checkPostCondition(YCheckPositions.scala:53)
at dotty.tools.dotc.transform.TreeChecker.dotty$tools$dotc$transform$TreeChecker$Checker$$_$typedUnadapted$$anonfun$1(TreeChecker.scala:318)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:305)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:318)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2156)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2168)
at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2244)
at dotty.tools.dotc.transform.TreeChecker.check(TreeChecker.scala:121)
at dotty.tools.dotc.transform.TreeChecker.run(TreeChecker.scala:94)
at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:315)
at scala.collection.immutable.List.map(List.scala:219)
at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:316)
at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:159)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
at dotty.tools.dotc.Run.runPhases$5(Run.scala:169)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:177)
at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
at dotty.tools.dotc.Run.compileUnits(Run.scala:184)
at dotty.tools.dotc.Run.compileSources(Run.scala:121)
at dotty.tools.dotc.Run.compile(Run.scala:104)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
at dotty.tools.dotc.Driver.process(Driver.scala:178)
at dotty.tools.dotc.Driver.process(Driver.scala:147)
at dotty.tools.dotc.Driver.process(Driver.scala:159)
at dotty.tools.dotc.Driver.main(Driver.scala:186)
at dotty.tools.dotc.Main.main(Main.scala)