Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Martres <[email protected]>
  • Loading branch information
odersky and smarter authored Mar 25, 2024
1 parent e07d50e commit 0f30c98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
def paramBounds(tparam: Symbol): TypeBounds =
tparam.info.substApprox(tparams2.asInstanceOf[List[Symbol]], args2).bounds

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

0 comments on commit 0f30c98

Please sign in to comment.