Skip to content

Commit 418a84c

Browse files
committed
Fix unapply for arrays after erasure
1 parent 7044a61 commit 418a84c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,7 @@ class Definitions {
10181018
else ArrayType.appliedTo(elem :: Nil)
10191019
def unapply(tp: Type)(using Context): Option[Type] = tp.dealias match {
10201020
case AppliedType(at, arg :: Nil) if at.isRef(ArrayType.symbol) => Some(arg)
1021+
case JavaArrayType(tp) if ctx.erasedTypes => Some(tp)
10211022
case _ => None
10221023
}
10231024
}

0 commit comments

Comments
 (0)