Skip to content

Commit bd77bff

Browse files
dwijnandsmarter
andauthored
Avoid generating skolems just to return true
Co-authored-by: Guillaume Martres <[email protected]>
1 parent b52fc0c commit bd77bff

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,9 @@ class SpaceEngine(using Context) extends SpaceLogic {
523523
/** Is `tp1` a subtype of `tp2`? */
524524
def isSubType(tp1: Type, tp2: Type): Boolean = trace(i"$tp1 <:< $tp1", debug, show = true) {
525525
if tp1 == constantNullType && !ctx.explicitNulls then tp2 == constantNullType
526-
else adaptType(tp1, tp2) <:< tp2
526+
else
527+
isPrimToBox(tp1, tp2) || isPrimToBox(tp2, tp1) ||
528+
convertConstantType(tp1, tp2) <:< tp2
527529
}
528530

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

0 commit comments

Comments
 (0)