diff options
author | Martin Odersky <odersky@gmail.com> | 2014-07-01 14:43:18 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-07-17 11:01:59 +0200 |
commit | 3ab2784948d084557e88cd7eb5c55a29613742d0 (patch) | |
tree | 62ce5b62fc08afc070e9e705687e9fa05a6e1947 /src/dotty/tools/dotc/core/Symbols.scala | |
parent | 8112a39d3a00f53a68af794d0a83cf995faf31e2 (diff) | |
download | dotty-3ab2784948d084557e88cd7eb5c55a29613742d0.tar.gz dotty-3ab2784948d084557e88cd7eb5c55a29613742d0.tar.bz2 dotty-3ab2784948d084557e88cd7eb5c55a29613742d0.zip |
Added phase: SuperAccessors
Rewrote SuperAccessors (more to be done; see comments), and
added stuff here and there to make it work smoother.
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 12 |
1 files changed, 12 insertions, 0 deletions
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 |