Skip to content

Commit 12d87df

Browse files
committed
Try picking the arg for simplicity
1 parent 0d6cde1 commit 12d87df

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,16 +458,17 @@ class QuoteMatcher(debug: Boolean) {
458458
* only when they have empty bounds (>: Nothing <: Any)
459459
*/
460460
def matchTypeDef(sctypedef: TypeDef, pttypedef: TypeDef): MatchingExprs =
461-
inline def recur(tds: Array[TypeDef], i: Int): MatchingExprs =
461+
inline def recur(i: Int): MatchingExprs =
462462
if i == 2 then
463463
matched
464464
else
465-
tds(i).rhs match
465+
val td = if i == 0 then sctypedef else pttypedef
466+
td.rhs match
466467
case tbt: TypeBoundsTree
467468
if tbt.lo.tpe.isNothingType && tbt.hi.tpe.isAny && tbt.alias.isEmpty
468-
=> recur(tds, i + 1)
469+
=> recur(i + 1)
469470
case _ => notMatched
470-
recur(Array(sctypedef, pttypedef), i = 0)
471+
recur(i = 0)
471472

472473
def matchParamss(scparamss: List[ParamClause], ptparamss: List[ParamClause])(using Env): optional[(Env, MatchingExprs)] =
473474
(scparamss, ptparamss) match {

0 commit comments

Comments
 (0)