@@ -253,7 +253,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
253
253
* @param prevCtx the context in which the reference was found
254
254
* @param using_Context the outer context of `precCtx`
255
255
*/
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 =
257
257
258
258
def addAltImport (altImp : TermRef ) =
259
259
if ! TypeComparer .isSameRef(previous, altImp)
@@ -268,16 +268,16 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
268
268
if prevPrec == WildImport then
269
269
// Discard all previously found references and continue with `altImp`
270
270
altImports.clear()
271
- checkImportAlternatives(altImp, NamedImport , ctx)(using ctx.outer)
271
+ checkImportAlternatives(altImp, NamedImport , ctx, 1 )(using ctx.outer)
272
272
else
273
273
addAltImport(altImp)
274
- checkImportAlternatives(previous, prevPrec, prevCtx)(using ctx.outer)
274
+ checkImportAlternatives(previous, prevPrec, prevCtx, 2 )(using ctx.outer)
275
275
case _ =>
276
276
if prevPrec == WildImport then
277
277
wildImportRef(curImport) match
278
278
case altImp : TermRef => addAltImport(altImp)
279
279
case _ =>
280
- checkImportAlternatives(previous, prevPrec, prevCtx)(using ctx.outer)
280
+ checkImportAlternatives(previous, prevPrec, prevCtx, 3 )(using ctx.outer)
281
281
else
282
282
val found = findRefRecur(previous, prevPrec, prevCtx)
283
283
if found eq previous then checkNewOrShadowed(found, prevPrec)(using prevCtx)
@@ -495,11 +495,11 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
495
495
else if (isPossibleImport(NamedImport ) && (curImport nen outer.importInfo)) {
496
496
val namedImp = namedImportRef(curImport.uncheckedNN)
497
497
if (namedImp.exists)
498
- checkImportAlternatives(namedImp, NamedImport , ctx)(using outer)
498
+ checkImportAlternatives(namedImp, NamedImport , ctx, 4 )(using outer)
499
499
else if (isPossibleImport(WildImport ) && ! curImport.nn.importSym.isCompleting) {
500
500
val wildImp = wildImportRef(curImport.uncheckedNN)
501
501
if (wildImp.exists)
502
- checkImportAlternatives(wildImp, WildImport , ctx)(using outer)
502
+ checkImportAlternatives(wildImp, WildImport , ctx, 5 )(using outer)
503
503
else {
504
504
updateUnimported()
505
505
loop(ctx)(using outer)
0 commit comments