diff options
author | Martin Odersky <odersky@gmail.com> | 2013-01-21 14:24:32 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-01-21 14:24:32 +0100 |
commit | 4822da28b769484f9dac3ec83d437149e0559a48 (patch) | |
tree | c3cb89f91f786a375a8ee2c4308a541d8b05be81 /src/dotty/tools/dotc/core/Periods.scala | |
parent | e59b8822f53fa6fad057ac9642d31e4026800bf5 (diff) | |
download | dotty-4822da28b769484f9dac3ec83d437149e0559a48.tar.gz dotty-4822da28b769484f9dac3ec83d437149e0559a48.tar.bz2 dotty-4822da28b769484f9dac3ec83d437149e0559a48.zip |
Changed NamedType dereferencing so that we need not keep track of name validity periods. Instead, we simply retry on missing member lookup in an earlier phase. This scheme is less complicated and works as long as names that are renamed in phase A are not re-used in a phase B >= A.
Diffstat (limited to 'src/dotty/tools/dotc/core/Periods.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Periods.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Periods.scala b/src/dotty/tools/dotc/core/Periods.scala index ed7156d7b..97384e509 100644 --- a/src/dotty/tools/dotc/core/Periods.scala +++ b/src/dotty/tools/dotc/core/Periods.scala @@ -23,13 +23,16 @@ abstract class Periods { self: Context => override val period = pd } + /** A new context that differs from the current one in its phase */ + def withPhase(pid: PhaseId): Context = withPeriod(Period(runId, pid)) + /** Execute `op` at given period */ def atPeriod[T](pd: Period)(op: Context => T) = op(ctx withPeriod pd) /** Execute `op` at given phase id */ def atPhase[T](pid: PhaseId)(op: Context => T) = - op(ctx withPeriod Period(runId, pid)) + op(ctx withPhase pid) } object Periods { |