From 8b2a63fa3ce33e271c5c8ba92253e4f412f18a9b Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 14 Mar 2014 13:36:36 +0100 Subject: [PATCH 1/2] Stop running phases after errors were encountered --- src/dotty/tools/dotc/Run.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dotty/tools/dotc/Run.scala b/src/dotty/tools/dotc/Run.scala index df7f433f9bcd..160390c4f47e 100644 --- a/src/dotty/tools/dotc/Run.scala +++ b/src/dotty/tools/dotc/Run.scala @@ -30,8 +30,10 @@ class Run(comp: Compiler)(implicit ctx: Context) { def compileSources(sources: List[SourceFile]) = Stats.monitorHeartBeat { if (sources forall (_.exists)) { units = sources map (new CompilationUnit(_)) - for (phase <- ctx.allPhases) - phase.runOn(units) + for (phase <- ctx.allPhases) { + if (!ctx.reporter.hasErrors) + phase.runOn(units) + } } } From 3bdc44f8984a565583fa5f3170edd9146aec1d5b Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 14 Mar 2014 13:37:12 +0100 Subject: [PATCH 2/2] Reset frozen for transformed class denotations. ... so that we can add new members to transformed class denotations. --- src/dotty/tools/dotc/core/Denotations.scala | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index 00b6815e742d..b185d15bf1f2 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -2,13 +2,17 @@ package dotty.tools package dotc package core -import SymDenotations.{ SymDenotation, NoDenotation } +import SymDenotations.{ SymDenotation, ClassDenotation, NoDenotation } import Contexts.{Context, ContextBase} import Names.{Name, PreName} import Names.TypeName import Symbols.NoSymbol import Symbols._ -import Types._, Periods._, Flags._, Transformers._, Decorators._ +import Types._ +import Periods._ +import Flags._ +import Transformers._ +import Decorators._ import transform.Erasure import printing.Texts._ import printing.Printer @@ -185,6 +189,9 @@ object Denotations { def requiredMethod(name: PreName)(implicit ctx: Context): TermSymbol = info.member(name.toTermName).requiredSymbol(_ is Method).asTerm + def requiredValue(name: PreName)(implicit ctx: Context): TermSymbol = + info.member(name.toTermName).requiredSymbol(_.info.isParameterless).asTerm + /** The denotation that has a type matching `targetType` when seen * as a member of type `site`, `NoDenotation` if none exists. */ @@ -514,6 +521,10 @@ object Denotations { if (next eq cur) startPid = cur.validFor.firstPhaseId else { + next match { + case next: ClassDenotation => next.resetFlag(Frozen) + case _ => + } cur.nextInRun = next cur = next }