Skip to content

Commit 95ffe46

Browse files
committed
made ArrayType constructor phase aware
Avoid to create ArrayTypes after erase. Note that the *extractor* does not recognize JavaArrayTypes as ArrayTypes. Doing so would create an infinite loop in sigName. Generally, we do not want to ppaper over the difference when analysing types.
1 parent 3ee4a25 commit 95ffe46

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ class Definitions {
394394

395395
object ArrayType {
396396
def apply(elem: Type)(implicit ctx: Context) =
397-
ArrayClass.typeRef.appliedTo(elem :: Nil)
397+
if (ctx.erasedTypes) JavaArrayType(elem)
398+
else ArrayClass.typeRef.appliedTo(elem :: Nil)
398399
def unapply(tp: Type)(implicit ctx: Context) = tp.dealias match {
399400
case at: RefinedType if (at isRef ArrayClass) && at.argInfos.length == 1 => Some(at.argInfos.head)
400401
case _ => None

0 commit comments

Comments
 (0)