aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-06-06 19:20:41 +0200
committerMartin Odersky <odersky@gmail.com>2013-06-06 19:20:41 +0200
commit1571ec5f39cacac6433cce0a140ebfb18e2ac314 (patch)
treebb27d85d7ef2e07a06805bc443795c56e9e1f1f6 /src/dotty/tools/dotc/core
parent5651846489834ed69cbb2dab88bc628cf6234dc9 (diff)
downloaddotty-1571ec5f39cacac6433cce0a140ebfb18e2ac314.tar.gz
dotty-1571ec5f39cacac6433cce0a140ebfb18e2ac314.tar.bz2
dotty-1571ec5f39cacac6433cce0a140ebfb18e2ac314.zip
Namer redesign.
A new design that relies on DefDef local maps, instead of global maps before.
Diffstat (limited to 'src/dotty/tools/dotc/core')
-rw-r--r--src/dotty/tools/dotc/core/Contexts.scala2
-rw-r--r--src/dotty/tools/dotc/core/Flags.scala3
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala2
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala4
4 files changed, 6 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala
index 346cf72f5..588c18c4c 100644
--- a/src/dotty/tools/dotc/core/Contexts.scala
+++ b/src/dotty/tools/dotc/core/Contexts.scala
@@ -262,7 +262,7 @@ object Contexts {
def withTree(tree: Tree[_ >: Untyped]): this.type = { this.tree = tree; this }
def withScope(scope: Scope): this.type = { this.scope = scope; this }
def withNewScope: this.type = { this.scope = newScope; this }
- def withTyper(typer: Typer): this.type = { this.typer = typer; this }
+ def withTyper(typer: Typer): this.type = { this.typer = typer; this.scope = typer.scope; this }
def withImport(importInfo: ImportInfo): this.type = { this.imports = importInfo :: imports; this }
def withReporter(reporter: Reporter): this.type = { this.reporter = reporter; this }
def withDiagnostics(diagnostics: Option[StringBuilder]): this.type = { this.diagnostics = diagnostics; this }
diff --git a/src/dotty/tools/dotc/core/Flags.scala b/src/dotty/tools/dotc/core/Flags.scala
index e15ca04d3..6e4777749 100644
--- a/src/dotty/tools/dotc/core/Flags.scala
+++ b/src/dotty/tools/dotc/core/Flags.scala
@@ -394,6 +394,9 @@ object Flags {
/** Module classes always have these flags set */
final val ModuleClassCreationFlags = ModuleClass | Final
+ /** The flags of the self symbol */
+ final val SelfSymFlags = Private | Local | Deferred
+
/** The flags of a type parameter */
final val TypeParamCreationFlags = TypeParam | Protected | Local
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index e1550d529..64119944c 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -638,8 +638,6 @@ object SymDenotations {
}
/** The contents of a class definition during a period
- * Note: important to leave initctx non-implicit, and to check that it is not
- * retained after object construction.
*/
class ClassDenotation private[SymDenotations] (
symbol: Symbol,
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index 23984c7a4..34b3eae73 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -213,8 +213,8 @@ trait Symbols { this: Context =>
newConstructor(cls, EmptyFlags, Nil, Nil)
/** Create a symbol representing a selftype declaration for class `cls`. */
- def newSelfSym(cls: ClassSymbol): TermSymbol =
- ctx.newSymbol(cls, nme.THIS, SyntheticArtifact, cls.classInfo.selfType)
+ def newSelfSym(cls: ClassSymbol, name: TermName = nme.WILDCARD, optSelfType: Type = NoType): TermSymbol =
+ ctx.newSymbol(cls, name, SelfSymFlags, optSelfType orElse cls.classInfo.selfType, coord = cls.coord)
/** Create new type parameters with given owner, names, and flags.
* @param boundsFn A function that, given type refs to the newly created