From 3ab2784948d084557e88cd7eb5c55a29613742d0 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 1 Jul 2014 14:43:18 +0200 Subject: Added phase: SuperAccessors Rewrote SuperAccessors (more to be done; see comments), and added stuff here and there to make it work smoother. --- src/dotty/tools/dotc/core/Symbols.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) (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 26553ddff..cfd5bdf23 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -16,6 +16,7 @@ import printing.Printer import Types._ import Annotations._ import util.Positions._ +import DenotTransformers._ import StdNames._ import NameOps._ import ast.tpd.{TreeTypeMap, Tree} @@ -372,6 +373,17 @@ object Symbols { this } + /** Enter this symbol in its class owner after given `phase`. Create a fresh + * denotation for its owner class if the class has not yet already one + * that starts being valid after `phase`. + * @pre Symbol is a class member + */ + def enteredAfter(phase: DenotTransformer)(implicit ctx: Context): this.type = { + val nextCtx = ctx.withPhase(phase.next) + this.owner.asClass.ensureFreshScopeAfter(phase)(nextCtx) + entered(nextCtx) + } + /** This symbol, if it exists, otherwise the result of evaluating `that` */ def orElse(that: => Symbol)(implicit ctx: Context) = if (this.exists) this else that -- cgit v1.2.3