aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymbolLoaders.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/SymbolLoaders.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymbolLoaders.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/SymbolLoaders.scala b/src/dotty/tools/dotc/core/SymbolLoaders.scala
index f947a23d8..972242fbd 100644
--- a/src/dotty/tools/dotc/core/SymbolLoaders.scala
+++ b/src/dotty/tools/dotc/core/SymbolLoaders.scala
@@ -31,6 +31,14 @@ abstract class SymbolLoaders(implicit ctx: Context) {
enterIfNew(owner, cls, completer)
}
+ /** Enter module with given `name` into scope of `root`
+ * and give them `completer` as type.
+ */
+ def enterModule(owner: Symbol, name: String, completer: SymbolLoader): Symbol = {
+ val module = ctx.newLazyModuleSymbol(owner, name.toTermName, EmptyFlags, completer)
+ enterIfNew(owner, module, completer)
+ }
+
abstract class SymbolLoader extends ClassCompleter
}
/*