Closed
Description
Compiler version
3.2.0-RC3
0c4c967
Minimized code
extension (c: Int)
def tap[U](f: Int => U): Int = ???
def foo: Int = 42 // no crash if foo is a `val`
def bar: Int = foo.tap(baz)
def baz(x: Int): Unit = ()
Output (click arrow to expand)
scalac -coverage-out:. test.scala
exception while typing {
scala.runtime.coverage.Invoker.invoked(4, ".")
tap(c$1)
} of class class dotty.tools.dotc.ast.Trees$Block # -1
exception while typing {
val c$1: Int =
{
scala.runtime.coverage.Invoker.invoked(3, ".")
foo
}
{
scala.runtime.coverage.Invoker.invoked(4, ".")
tap(c$1)
}
} of class class dotty.tools.dotc.ast.Trees$Block # -1
exception while typing {
val c$1: Int =
{
scala.runtime.coverage.Invoker.invoked(3, ".")
foo
}
{
scala.runtime.coverage.Invoker.invoked(4, ".")
tap(c$1)
}
}[Unit] of class class dotty.tools.dotc.ast.Trees$TypeApply # -1
exception while typing {
val c$1: Int =
{
scala.runtime.coverage.Invoker.invoked(3, ".")
foo
}
{
scala.runtime.coverage.Invoker.invoked(4, ".")
tap(c$1)
}
}[Unit](
{
def $anonfun(x: Int): Unit =
{
scala.runtime.coverage.Invoker.invoked(5, ".")
baz(x)
}
closure($anonfun)
}
) of class class dotty.tools.dotc.ast.Trees$Apply # -1
exception while typing {
scala.runtime.coverage.Invoker.invoked(6, ".")
{
val c$1: Int =
{
scala.runtime.coverage.Invoker.invoked(3, ".")
foo
}
{
scala.runtime.coverage.Invoker.invoked(4, ".")
tap(c$1)
}
}[Unit](
{
def $anonfun(x: Int): Unit =
{
scala.runtime.coverage.Invoker.invoked(5, ".")
baz(x)
}
closure($anonfun)
}
)
} of class class dotty.tools.dotc.ast.Trees$Block # -1
exception while typing {
scala.runtime.coverage.Invoker.invoked(7, ".")
{
scala.runtime.coverage.Invoker.invoked(6, ".")
{
val c$1: Int =
{
scala.runtime.coverage.Invoker.invoked(3, ".")
foo
}
{
scala.runtime.coverage.Invoker.invoked(4, ".")
tap(c$1)
}
}[Unit](
{
def $anonfun(x: Int): Unit =
{
scala.runtime.coverage.Invoker.invoked(5, ".")
baz(x)
}
closure($anonfun)
}
)
}
} of class class dotty.tools.dotc.ast.Trees$Block # -1
exception while typing def bar: Int =
{
scala.runtime.coverage.Invoker.invoked(7, ".")
{
scala.runtime.coverage.Invoker.invoked(6, ".")
{
val c$1: Int =
{
scala.runtime.coverage.Invoker.invoked(3, ".")
foo
}
{
scala.runtime.coverage.Invoker.invoked(4, ".")
tap(c$1)
}
}[Unit](
{
def $anonfun(x: Int): Unit =
{
scala.runtime.coverage.Invoker.invoked(5, ".")
baz(x)
}
closure($anonfun)
}
)
}
} of class class dotty.tools.dotc.ast.Trees$DefDef # -1
exception while typing @SourceFile("test.scala") final module class test$package() extends Object() {
private def writeReplace(): AnyRef =
new scala.runtime.ModuleSerializationProxy(classOf[test$package.type])
extension (c: Int) def tap[U](f: Int => U): Int =
{
scala.runtime.coverage.Invoker.invoked(1, ".")
{
scala.runtime.coverage.Invoker.invoked(0, ".")
???
}
}
def foo: Int =
{
scala.runtime.coverage.Invoker.invoked(2, ".")
42
}
def bar: Int =
{
scala.runtime.coverage.Invoker.invoked(7, ".")
{
scala.runtime.coverage.Invoker.invoked(6, ".")
{
val c$1: Int =
{
scala.runtime.coverage.Invoker.invoked(3, ".")
foo
}
{
scala.runtime.coverage.Invoker.invoked(4, ".")
tap(c$1)
}
}[Unit](
{
def $anonfun(x: Int): Unit =
{
scala.runtime.coverage.Invoker.invoked(5, ".")
baz(x)
}
closure($anonfun)
}
)
}
}
def baz(x: Int): Unit =
{
scala.runtime.coverage.Invoker.invoked(8, ".")
()
}
} of class class dotty.tools.dotc.ast.Trees$TypeDef # -1
exception while typing package <empty> {
final lazy module val test$package: test$package = new test$package()
@SourceFile("test.scala") final module class test$package() extends Object() {
private def writeReplace(): AnyRef =
new scala.runtime.ModuleSerializationProxy(classOf[test$package.type])
extension (c: Int) def tap[U](f: Int => U): Int =
{
scala.runtime.coverage.Invoker.invoked(1, ".")
{
scala.runtime.coverage.Invoker.invoked(0, ".")
???
}
}
def foo: Int =
{
scala.runtime.coverage.Invoker.invoked(2, ".")
42
}
def bar: Int =
{
scala.runtime.coverage.Invoker.invoked(7, ".")
{
scala.runtime.coverage.Invoker.invoked(6, ".")
{
val c$1: Int =
{
scala.runtime.coverage.Invoker.invoked(3, ".")
foo
}
{
scala.runtime.coverage.Invoker.invoked(4, ".")
tap(c$1)
}
}[Unit](
{
def $anonfun(x: Int): Unit =
{
scala.runtime.coverage.Invoker.invoked(5, ".")
baz(x)
}
closure($anonfun)
}
)
}
}
def baz(x: Int): Unit =
{
scala.runtime.coverage.Invoker.invoked(8, ".")
()
}
}
} of class class dotty.tools.dotc.ast.Trees$PackageDef # -1
exception occurred while compiling test.scala
java.lang.AssertionError: assertion failed while compiling test.scala
Exception in thread "main" java.lang.AssertionError: assertion failed
at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11)
at dotty.tools.dotc.transform.Erasure$Boxing$.adaptToType(Erasure.scala:388)
at dotty.tools.dotc.transform.Erasure$Typer.adapt(Erasure.scala:1053)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2987)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2991)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3107)
at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1062)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2867)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2922)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2987)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2991)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3107)
at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1062)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2867)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2922)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2987)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2991)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3107)
at dotty.tools.dotc.transform.Erasure$Typer.typedTypeApply(Erasure.scala:807)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2878)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2922)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2987)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2991)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3107)
at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:826)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2859)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2922)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2987)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2991)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3107)
at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1062)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2867)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2922)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2987)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2991)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3107)
at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1062)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2867)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2922)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2987)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2991)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3107)
at dotty.tools.dotc.typer.Typer.$anonfun$48(Typer.scala:2295)
at dotty.tools.dotc.typer.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:248)
at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2295)
at dotty.tools.dotc.transform.Erasure$Typer.typedDefDef(Erasure.scala:943)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2835)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2921)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2987)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2991)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3013)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3063)
at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1041)
at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2500)
at dotty.tools.dotc.transform.Erasure$Typer.typedClassDef(Erasure.scala:1031)
at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:2847)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2851)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2921)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2987)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2991)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3013)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3063)
at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:1041)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2629)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2892)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2922)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:126)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2987)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2991)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3107)
at dotty.tools.dotc.transform.Erasure.run(Erasure.scala:144)
at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:311)
at scala.collection.immutable.List.map(List.scala:246)
at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:312)
at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:234)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1328)
at dotty.tools.dotc.Run.runPhases$1(Run.scala:245)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:253)
at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:262)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:68)
at dotty.tools.dotc.Run.compileUnits(Run.scala:262)
at dotty.tools.dotc.Run.compileSources(Run.scala:186)
at dotty.tools.dotc.Run.compile(Run.scala:170)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
at dotty.tools.dotc.Driver.process(Driver.scala:195)
at dotty.tools.dotc.Driver.process(Driver.scala:163)
at dotty.tools.dotc.Driver.process(Driver.scala:175)
at dotty.tools.dotc.Driver.main(Driver.scala:205)
at dotty.tools.dotc.Main.main(Main.scala)
/cc @TheElectronWill