Skip to content

Commit 0f30c98

Browse files
oderskysmarter
andauthored
Apply suggestions from code review
Co-authored-by: Guillaume Martres <[email protected]>
1 parent e07d50e commit 0f30c98

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
16911691
def paramBounds(tparam: Symbol): TypeBounds =
16921692
tparam.info.substApprox(tparams2.asInstanceOf[List[Symbol]], args2).bounds
16931693

1694-
/** Test all arguments. Hard argument tests (according to isHard) are deferred in
1694+
/** Test all arguments. Incomplete argument tests (according to isIncomplete) are deferred in
16951695
* the first run and picked up in the second.
16961696
*/
16971697
def recurArgs(args1: List[Type], args2: List[Type], tparams2: List[ParamInfo],
@@ -1714,8 +1714,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
17141714
* comparison will instantiate or constrain type variables first.
17151715
*/
17161716
def isIncomplete(arg1: Type, arg2: Type): Boolean =
1717-
val arg1d = arg1.stripped
1718-
val arg2d = arg2.stripped
1717+
val arg1d = arg1.strippedDealias
1718+
val arg2d = arg2.strippedDealias
17191719
(v >= 0) && (arg1d.isInstanceOf[AndType] || arg2d.isInstanceOf[OrType])
17201720
||
17211721
(v <= 0) && (arg1d.isInstanceOf[OrType] || arg2d.isInstanceOf[AndType])
@@ -1810,7 +1810,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
18101810
val rest1 = args1.tail
18111811
if !canDefer
18121812
|| rest1.isEmpty && deferred1.isEmpty
1813-
// skip the hardness test if this is the last argument and no previous arguments were hard
1813+
// skip the incompleteness test if this is the last argument and no previous argument tests were incomplete
18141814
|| !isIncomplete(arg1, arg2)
18151815
then
18161816
isSubArg(arg1, arg2)

0 commit comments

Comments
 (0)