Skip to content

Commit d8139fc

Browse files
committed
address review
Use TypeBounds instead of WildcardType. WildcardType has the following unexpected behavior: Array[?] <:< Array[Array[?]]
1 parent f9700b1 commit d8139fc

File tree

1 file changed

+1
-4
lines changed
  • compiler/src/dotty/tools/dotc/transform/patmat

1 file changed

+1
-4
lines changed

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,8 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
356356

357357
val map = new TypeMap {
358358
def apply(tp: Type) = tp match {
359-
case tp @ AppliedType(tycon, args) if tycon.isRef(defn.ArrayClass) =>
360-
// walkaround `Array[_] <:< Array[Array[_]]`, see tests/patmat/t2425.scala
361-
tp.derivedAppliedType(tycon, args.map(mapOver))
362359
case tref: TypeRef if isPatternTypeSymbol(tref.typeSymbol) =>
363-
WildcardType(tref.underlying.bounds)
360+
tref.underlying.bounds
364361
case _ => mapOver(tp)
365362
}
366363
}

0 commit comments

Comments
 (0)