Skip to content

Commit fbc2e6f

Browse files
committed
patmat: Separate regular subtyping checks from adapted checks
1 parent 08ef279 commit fbc2e6f

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ class SpaceEngine(using Context) extends SpaceLogic {
533533
/** Is `tp1` a subtype of `tp2`? */
534534
def isSubType(tp1: Type, tp2: Type): Boolean = trace(i"$tp1 <:< $tp2", debug, show = true) {
535535
if tp1 == constantNullType && !ctx.explicitNulls then tp2 == constantNullType
536-
else adaptType(tp1, tp2) <:< tp2
536+
else tp1 <:< tp2 || adaptType(tp1, tp2) <:< tp2
537537
}
538538

539539
def isSameUnapply(tp1: TermRef, tp2: TermRef): Boolean =

0 commit comments

Comments
 (0)