diff options
author | Martin Odersky <odersky@gmail.com> | 2013-02-01 15:00:03 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-02-01 15:00:03 +0100 |
commit | 5610fe1abbb8e4cb005d644f37669f872327828b (patch) | |
tree | e8c1f9c7a18e1ea299c14d421fcd251f1c2a4dfc /src/dotty/tools/dotc/core/SymbolLoaders.scala | |
parent | 4faeeceffdbc8dec9dd53bf299174a13d6bf87d0 (diff) | |
download | dotty-5610fe1abbb8e4cb005d644f37669f872327828b.tar.gz dotty-5610fe1abbb8e4cb005d644f37669f872327828b.tar.bz2 dotty-5610fe1abbb8e4cb005d644f37669f872327828b.zip |
Refined completion, in particular for module symbols and made contexts explicit.
Made contexts in class constructors explicit (named initctx), so that we can better track where they are used. It's important that the context is not retained in the state of the object.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymbolLoaders.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymbolLoaders.scala | 8 |
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 } /* |