Skip to content

Commit b701344

Browse files
committed
Avoid naming issues
1 parent 1892d65 commit b701344

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
166166
* a reference for `m` is searched. `null` in all other situations.
167167
*/
168168
def findRef(name: Name, pt: Type, required: FlagSet, excluded: FlagSet, pos: SrcPos,
169-
altImports: mutable.ListBuffer[TermRef] | Null = null)(using Context): Type = {
170-
val refctx = ctx
169+
altImports: mutable.ListBuffer[TermRef] | Null = null)(using refctx: Context): Type = {
171170
val noImports = ctx.mode.is(Mode.InPackageClauseName)
172171
def suppressErrors = excluded.is(ConstructorProxy)
173172
// when searching for references shadowed by a constructor proxy, do not report errors
@@ -211,7 +210,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
211210
* @param prevCtx The context of the previous denotation,
212211
* or else `NoContext` if nothing was found yet.
213212
*/
214-
def findRefRecur(previous: Type, prevPrec: BindingPrec, prevCtx: Context)(using Context): Type = {
213+
def findRefRecur(previous: Type, prevPrec: BindingPrec, prevCtx: Context)(using recCtx: Context): Type = {
215214
import BindingPrec._
216215

217216
/** Check that any previously found result from an inner context
@@ -253,7 +252,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
253252
* @param prevCtx the context in which the reference was found
254253
* @param using_Context the outer context of `precCtx`
255254
*/
256-
def checkImportAlternatives(previous: Type, prevPrec: BindingPrec, prevCtx: Context)(using Context): Type =
255+
def checkImportAlternatives(previous: Type, prevPrec: BindingPrec, prevCtx: Context)(using impCtx: Context): Type =
257256

258257
def addAltImport(altImp: TermRef) =
259258
if !TypeComparer.isSameRef(previous, altImp)
@@ -371,7 +370,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
371370
!noImports &&
372371
(prevPrec.ordinal < prec.ordinal || prevPrec == prec && (prevCtx.scope eq ctx.scope))
373372

374-
@tailrec def loop(lastCtx: Context)(using Context): Type =
373+
@tailrec def loop(lastCtx: Context)(using loopCtx: Context): Type =
375374
if (ctx.scope eq EmptyScope) previous
376375
else {
377376
var result: Type = NoType

0 commit comments

Comments
 (0)