Skip to content

Commit 3c07ab5

Browse files
committed
I don't understand
1 parent 1892d65 commit 3c07ab5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
253253
* @param prevCtx the context in which the reference was found
254254
* @param using_Context the outer context of `precCtx`
255255
*/
256-
def checkImportAlternatives(previous: Type, prevPrec: BindingPrec, prevCtx: Context)(using Context): Type =
256+
def checkImportAlternatives(previous: Type, prevPrec: BindingPrec, prevCtx: Context, n: Int)(using Context): Type =
257257

258258
def addAltImport(altImp: TermRef) =
259259
if !TypeComparer.isSameRef(previous, altImp)
@@ -268,16 +268,16 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
268268
if prevPrec == WildImport then
269269
// Discard all previously found references and continue with `altImp`
270270
altImports.clear()
271-
checkImportAlternatives(altImp, NamedImport, ctx)(using ctx.outer)
271+
checkImportAlternatives(altImp, NamedImport, ctx, 1)(using ctx.outer)
272272
else
273273
addAltImport(altImp)
274-
checkImportAlternatives(previous, prevPrec, prevCtx)(using ctx.outer)
274+
checkImportAlternatives(previous, prevPrec, prevCtx, 2)(using ctx.outer)
275275
case _ =>
276276
if prevPrec == WildImport then
277277
wildImportRef(curImport) match
278278
case altImp: TermRef => addAltImport(altImp)
279279
case _ =>
280-
checkImportAlternatives(previous, prevPrec, prevCtx)(using ctx.outer)
280+
checkImportAlternatives(previous, prevPrec, prevCtx, 3)(using ctx.outer)
281281
else
282282
val found = findRefRecur(previous, prevPrec, prevCtx)
283283
if found eq previous then checkNewOrShadowed(found, prevPrec)(using prevCtx)
@@ -495,11 +495,11 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
495495
else if (isPossibleImport(NamedImport) && (curImport nen outer.importInfo)) {
496496
val namedImp = namedImportRef(curImport.uncheckedNN)
497497
if (namedImp.exists)
498-
checkImportAlternatives(namedImp, NamedImport, ctx)(using outer)
498+
checkImportAlternatives(namedImp, NamedImport, ctx, 4)(using outer)
499499
else if (isPossibleImport(WildImport) && !curImport.nn.importSym.isCompleting) {
500500
val wildImp = wildImportRef(curImport.uncheckedNN)
501501
if (wildImp.exists)
502-
checkImportAlternatives(wildImp, WildImport, ctx)(using outer)
502+
checkImportAlternatives(wildImp, WildImport, ctx, 5)(using outer)
503503
else {
504504
updateUnimported()
505505
loop(ctx)(using outer)

0 commit comments

Comments
 (0)