You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importreflect.ClassTagobjectDemo {
defthe[T](implicitev: T): ev.type= ev // More precise implicitly, needed to crash
{
caseclassB(i: Int)
the[ClassTag[B]] // Has to be the last statement of the block
}
}
Crashes with the following:
Exception in thread "main" java.lang.AssertionError: assertion failed: leak: B in {
caseclassB(i: Int) extendsObject() with _root_.scala.Product {
vali:Intdefcopy(i: Int):B=newB(i)
defcopy$default$1:Int@uncheckedVariance =B.this.i:Int@uncheckedVariance
def_1:Int=this.i
}
finallazy module valB:B=newB()
final module classB() extendsObject() withFunction1[Int, B] {
this:B.type=>defapply(i: Int):B=newB(i)
defunapply(x$1: B):B= x$1
}
Demo.the[reflect.ClassTag[B]](
scala.reflect.ClassTag.apply[B](classOf[classB])
):ClassTag[B](?1)
}
at scala.Predef$.assert(Predef.scala:219)
at dotty.tools.dotc.typer.Typer.ensureNoLocalRefs(Typer.scala:671)
at dotty.tools.dotc.typer.Typer.$anonfun$typedBlock$1(Typer.scala:634)
...
The text was updated successfully, but these errors were encountered:
Crashes with the following:
The text was updated successfully, but these errors were encountered: