Skip to content

Commit c3be507

Browse files
committed
Refine interdiction of Array after erasure
Array is still allowed after erasure when compiling Array.scala.
1 parent f75f2ad commit c3be507

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ class Erasure extends Phase with DenotTransformer { thisTransformer =>
109109
}
110110

111111
def assertErased(tp: Type, tree: tpd.Tree = tpd.EmptyTree)(implicit ctx: Context): Unit =
112-
assert(isErasedType(tp), i"The type $tp - ${tp.toString} of class ${tp.getClass} of tree $tree : ${tree.tpe} / ${tree.getClass} is illegal after erasure, phase = ${ctx.phase.prev}")
112+
if (tp.typeSymbol == defn.ArrayClass &&
113+
ctx.compilationUnit.source.file.name == "Array.scala") {} // ok
114+
else
115+
assert(isErasedType(tp),
116+
i"The type $tp - ${tp.toString} of class ${tp.getClass} of tree $tree : ${tree.tpe} / ${tree.getClass} is illegal after erasure, phase = ${ctx.phase.prev}")
113117
}
114118

115119
object Erasure extends TypeTestsCasts{

0 commit comments

Comments
 (0)