Skip to content

Commit e9838a2

Browse files
committed
Make ImportInfo take an IFT argument
1 parent cb45ba9 commit e9838a2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/core/Contexts.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ object Contexts {
404404
case _ => None
405405
}
406406
ctx.fresh.setImportInfo(
407-
new ImportInfo(implicit ctx => sym, imp.selectors, impNameOpt, imp.importDelegate))
407+
ImportInfo(sym, imp.selectors, impNameOpt, imp.importDelegate))
408408
}
409409

410410
/** Does current phase use an erased types interpretation? */

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ object ImportInfo {
1919
val selectors = untpd.Ident(nme.WILDCARD) :: Nil
2020
def expr(implicit ctx: Context) = tpd.Ident(refFn())
2121
def imp(implicit ctx: Context) = tpd.Import(importDelegate = importDelegate, expr, selectors)
22-
new ImportInfo(implicit ctx => imp.symbol, selectors, None, importDelegate = importDelegate, isRootImport = true)
22+
new ImportInfo(imp.symbol, selectors, None, importDelegate = importDelegate, isRootImport = true)
2323
}
2424
}
2525

@@ -32,7 +32,7 @@ object ImportInfo {
3232
* @param isRootImport true if this is one of the implicit imports of scala, java.lang,
3333
* scala.Predef or dotty.DottyPredef in the start context, false otherwise.
3434
*/
35-
class ImportInfo(symf: Context => Symbol, val selectors: List[untpd.Tree],
35+
class ImportInfo(symf: given Context => Symbol, val selectors: List[untpd.Tree],
3636
symNameOpt: Option[TermName],
3737
val importDelegate: Boolean,
3838
val isRootImport: Boolean = false) extends Showable {
@@ -41,7 +41,7 @@ class ImportInfo(symf: Context => Symbol, val selectors: List[untpd.Tree],
4141
// that we cannot use one for `DottyPredefModuleRef`.
4242
def sym(implicit ctx: Context): Symbol = {
4343
if (mySym == null) {
44-
mySym = symf(ctx)
44+
mySym = symf given ctx
4545
assert(mySym != null)
4646
}
4747
mySym

0 commit comments

Comments
 (0)