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
In the companion object of an opaque type T, creating an array using new Array[T] causes an assertion error. Seems to work outside the companion.
Code:
exception occurred while compiling opaque-array.scala
java.lang.AssertionError: assertion failed while compiling opaque-array.scala
Exception in thread "main" java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:208)
at dotty.tools.dotc.ast.tpd$.newArray(tpd.scala:410)
at dotty.tools.dotc.transform.ArrayConstructors.expand$1(ArrayConstructors.scala:29)
at dotty.tools.dotc.transform.ArrayConstructors.transformApply(ArrayConstructors.scala:33)
at dotty.tools.dotc.transform.MegaPhase.goApply(MegaPhase.scala:611)
at dotty.tools.dotc.transform.MegaPhase.goApply(MegaPhase.scala:612)
at dotty.tools.dotc.transform.MegaPhase.goApply(MegaPhase.scala:612)
at dotty.tools.dotc.transform.MegaPhase.goApply(MegaPhase.scala:612)
at dotty.tools.dotc.transform.MegaPhase.goApply(MegaPhase.scala:612)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:272)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:396)
at dotty.tools.dotc.transform.MegaPhase.mapValDef$1(MegaPhase.scala:234)
at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:238)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:394)
at dotty.tools.dotc.transform.MegaPhase.transformStat$1(MegaPhase.scala:404)
at dotty.tools.dotc.transform.MegaPhase.$anonfun$transformStats$2(MegaPhase.scala:409)
at scala.collection.immutable.List.mapConserve(List.scala:179)
at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:409)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:339)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:396)
at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:251)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:394)
at dotty.tools.dotc.transform.MegaPhase.transformStat$1(MegaPhase.scala:404)
at dotty.tools.dotc.transform.MegaPhase.$anonfun$transformStats$2(MegaPhase.scala:409)
at scala.collection.immutable.List.mapConserve(List.scala:179)
at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:409)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:339)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:396)
at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:251)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:394)
at dotty.tools.dotc.transform.MegaPhase.transformStat$1(MegaPhase.scala:404)
at dotty.tools.dotc.transform.MegaPhase.$anonfun$transformStats$2(MegaPhase.scala:409)
at scala.collection.immutable.List.mapConserve(List.scala:179)
at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:409)
at dotty.tools.dotc.transform.MegaPhase.mapPackage$1(MegaPhase.scala:356)
at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:359)
at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:396)
at dotty.tools.dotc.transform.MegaPhase.transformUnit(MegaPhase.scala:415)
at dotty.tools.dotc.transform.MegaPhase.run(MegaPhase.scala:427)
at dotty.tools.dotc.core.Phases$Phase.$anonfun$runOn$1(Phases.scala:316)
at scala.collection.immutable.List.map(List.scala:286)
at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:314)
at dotty.tools.dotc.Run.$anonfun$compileUnits$3(Run.scala:158)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at dotty.tools.dotc.util.Stats$.trackTime(Stats.scala:49)
at dotty.tools.dotc.Run.$anonfun$compileUnits$2(Run.scala:155)
at dotty.tools.dotc.Run.$anonfun$compileUnits$2$adapted(Run.scala:153)
at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198)
at dotty.tools.dotc.Run.runPhases$1(Run.scala:153)
at dotty.tools.dotc.Run.$anonfun$compileUnits$1(Run.scala:178)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:102)
at dotty.tools.dotc.Run.compileUnits(Run.scala:133)
at dotty.tools.dotc.Run.compileSources(Run.scala:120)
at dotty.tools.dotc.Run.compile(Run.scala:104)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:33)
at dotty.tools.dotc.Driver.process(Driver.scala:170)
at dotty.tools.dotc.Driver.process(Driver.scala:139)
at dotty.tools.dotc.Driver.process(Driver.scala:151)
at dotty.tools.dotc.Driver.main(Driver.scala:178)
at dotty.tools.dotc.Main.main(Main.scala)
The text was updated successfully, but these errors were encountered:
In the companion object of an opaque type
T
, creating an array usingnew Array[T]
causes an assertion error. Seems to work outside the companion.Code:
Output:
The text was updated successfully, but these errors were encountered: