From e8366c0fe9b5c04ba471d9f3f572d9ea0c684fbb Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 8 Feb 2013 22:46:59 +0100 Subject: Added new utility methods to SymDenotations and refactored creation. --- src/dotty/tools/dotc/core/Symbols.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/core/Symbols.scala') diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index c345128b3..76c329d66 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -47,7 +47,7 @@ trait Symbols { this: Context => newLazyModuleSymbols(owner, name, PackageCreationFlags, completer) def newSymbol[N <: Name](owner: Symbol, name: N, flags: FlagSet, info: Type, privateWithin: Symbol = NoSymbol) = - new Symbol(new CompleteSymDenotation(_, owner, name, flags, privateWithin, info)) { + new Symbol(CompleteSymDenotation(_, owner, name, flags, info, privateWithin)) { type ThisName = N } @@ -62,7 +62,7 @@ trait Symbols { this: Context => assocFile: AbstractFile = null) = new ClassSymbol(new CompleteClassDenotation( - _, owner, name, flags, privateWithin, parents, optSelfType, decls, assocFile)(this)) + _, owner, name, flags, parents, privateWithin, optSelfType, decls, assocFile)(this)) def newModuleSymbols( owner: Symbol, @@ -166,7 +166,7 @@ object Symbols { def show(implicit ctx: Context): String = ctx.show(this) def showLocated(implicit ctx: Context): String = ctx.showLocated(this) - def showDef(implicit ctx: Context): String = ctx.showDef(this) + def showDcl(implicit ctx: Context): String = ctx.showDcl(this) def showKind(implicit tcx: Context): String = ??? def showName(implicit ctx: Context): String = ??? } @@ -186,7 +186,8 @@ object Symbols { def superId(implicit ctx: Context): Int = { val hint = superIdHint val key = this.typeConstructor - if (hint >= 0 && hint <= ctx.lastSuperId && (ctx.classOfId(hint) eq key)) hint + if (hint >= 0 && hint <= ctx.lastSuperId && (ctx.classOfId(hint) eq key)) + hint else { val id = ctx.superIdOfClass get key match { case Some(id) => -- cgit v1.2.3