Skip to content

Commit 040b831

Browse files
committed
Refactor #2
We're looping over indices and then indexing a *list*.
1 parent ddf26ee commit 040b831

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,10 @@ object ProtoTypes {
457457
s"inconsistent: no typevars were added to committable constraint ${state.constraint}")
458458

459459
def newTypeVars(tl: TypeLambda): List[TypeTree] =
460-
for (n <- (0 until tl.paramNames.length).toList)
460+
for (paramRef <- tl.paramRefs)
461461
yield {
462462
val tt = new TypeVarBinder().withPos(owningTree.pos)
463-
val tvar = new TypeVar(tl.paramRefs(n), state)
463+
val tvar = new TypeVar(paramRef, state)
464464
state.ownedVars += tvar
465465
tt.withType(tvar)
466466
}

0 commit comments

Comments
 (0)