From 4822da28b769484f9dac3ec83d437149e0559a48 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 21 Jan 2013 14:24:32 +0100 Subject: 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. --- src/dotty/tools/dotc/core/Periods.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/Periods.scala') 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 { -- cgit v1.2.3