From 040b83167f4410ce10687a8bf2e10df79c8f26b9 Mon Sep 17 00:00:00 2001
From: "Paolo G. Giarrusso"
Date: Wed, 15 Aug 2018 14:57:40 +0200
Subject: [PATCH] Refactor #2
We're looping over indices and then indexing a *list*.
---
compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
index 199da3747b7c..020d3a8dcfd8 100644
--- a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
+++ b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
@@ -457,10 +457,10 @@ object ProtoTypes {
s"inconsistent: no typevars were added to committable constraint ${state.constraint}")
def newTypeVars(tl: TypeLambda): List[TypeTree] =
- for (n <- (0 until tl.paramNames.length).toList)
+ for (paramRef <- tl.paramRefs)
yield {
val tt = new TypeVarBinder().withPos(owningTree.pos)
- val tvar = new TypeVar(tl.paramRefs(n), state)
+ val tvar = new TypeVar(paramRef, state)
state.ownedVars += tvar
tt.withType(tvar)
}