diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/config/Printers.scala | 5 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 3 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 14 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/config/Printers.scala b/src/dotty/tools/dotc/config/Printers.scala index 407e93714..7f9c73926 100644 --- a/src/dotty/tools/dotc/config/Printers.scala +++ b/src/dotty/tools/dotc/config/Printers.scala @@ -11,10 +11,11 @@ object Printers { } val core: Printer = noPrinter - val typr: Printer = new Printer - val constr: Printer = new Printer + val typr: Printer = noPrinter + val constr: Printer = noPrinter val overload: Printer = noPrinter val implicits: Printer = noPrinter val unapp: Printer = noPrinter + val completions = noPrinter }
\ No newline at end of file diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 58f148ba5..18b5c5f8f 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -12,6 +12,7 @@ import Decorators.SymbolIteratorDecorator import annotation.tailrec import util.SimpleMap import config.Config +import config.Printers._ trait SymDenotations { this: Context => import SymDenotations._ @@ -127,7 +128,7 @@ object SymDenotations { if (myFlags is Touched) throw new CyclicReference(this) myFlags |= Touched - Context.theBase.initialCtx.debugTraceIndented(s"completing ${this.debugString}") { + Context.theBase.initialCtx.traceIndented(completions, s"completing ${this.debugString}") { // println("completing " + debugString) completer.complete(this) } diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 317827129..c0e39c44c 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -327,7 +327,8 @@ class Namer { typer: Typer => private def typeSig(sym: Symbol): Type = original match { case original: ValDef => - valOrDefDefSig(original, sym, Nil, identity)(localContext(sym).withNewScope) + if (sym is Module) moduleValSig(sym) + else valOrDefDefSig(original, sym, Nil, identity)(localContext(sym).withNewScope) case original: DefDef => val typer1 = new Typer nestedTyper(sym) = typer1 @@ -420,6 +421,17 @@ class Namer { typer: Typer => for (param <- params) typedAheadExpr(param) } + /** The signature of a module valdef. + * This will compute the corresponding module class TypeRef immediately + * without going through the defined type of the ValDef. This is necessary + * to avoid cyclic references involving imports and module val defs. + */ + def moduleValSig(sym: Symbol)(implicit ctx: Context): Type = { + val clsName = sym.name.moduleClassName + val cls = ctx.denotNamed(clsName) suchThat (_ is ModuleClass) + ctx.owner.thisType select (clsName, cls) + } + /** The type signature of a ValDef or DefDef * @param mdef The definition * @param sym Its symbol |