From 25b7a16700120910dee828d8e745df6400ba01d0 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Tue, 28 Apr 2015 11:38:30 +0200 Subject: [PATCH 1/2] Update comments on ParamForwarding and SuperAccessors. --- src/dotty/tools/dotc/transform/ParamForwarding.scala | 2 +- src/dotty/tools/dotc/transform/SuperAccessors.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dotty/tools/dotc/transform/ParamForwarding.scala b/src/dotty/tools/dotc/transform/ParamForwarding.scala index 87ecaba07956..d017e75a2e04 100644 --- a/src/dotty/tools/dotc/transform/ParamForwarding.scala +++ b/src/dotty/tools/dotc/transform/ParamForwarding.scala @@ -11,7 +11,7 @@ import Contexts._, Types._, Symbols._, Flags._, TypeUtils._, DenotTransformers._ * * if * (1) x is forwarded in the supercall to a parameter that's also named `x` - * (2) the superclass parameter accessor for `x` is accessible from the current class to + * (2) the superclass parameter accessor for `x` is accessible from the current class * change the accessor to * * def x: T = super.x.asInstanceOf[T] diff --git a/src/dotty/tools/dotc/transform/SuperAccessors.scala b/src/dotty/tools/dotc/transform/SuperAccessors.scala index b111fdb9289a..a37b8df1fd47 100644 --- a/src/dotty/tools/dotc/transform/SuperAccessors.scala +++ b/src/dotty/tools/dotc/transform/SuperAccessors.scala @@ -48,7 +48,7 @@ class SuperAccessors(thisTransformer: DenotTransformer) { * of adding accessors. For instance, super calls from these regions * always have to go through an accessor. * - * The `invalidOwner` field, if different from NoSymbol, + * The `invalidEnclClass` field, if different from NoSymbol, * contains the symbol that is not a valid owner. */ private var invalidEnclClass: Symbol = NoSymbol From 114963430eb0ef5519e7ec073a18eef0bc264237 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 28 Apr 2015 14:22:41 +0200 Subject: [PATCH 2/2] Display compiled files in case of exception This is useful for reproducing a problem. It tells us in particular in what order fiels were compiled. --- src/dotty/tools/dotc/Run.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dotty/tools/dotc/Run.scala b/src/dotty/tools/dotc/Run.scala index af9c878f0f80..3d4cd988e310 100644 --- a/src/dotty/tools/dotc/Run.scala +++ b/src/dotty/tools/dotc/Run.scala @@ -10,6 +10,7 @@ import reporting.Reporter import transform.TreeChecker import java.io.{BufferedWriter, OutputStreamWriter} import scala.reflect.io.VirtualFile +import scala.util.control.NonFatal class Run(comp: Compiler)(implicit ctx: Context) { @@ -27,9 +28,13 @@ class Run(comp: Compiler)(implicit ctx: Context) { } } - def compile(fileNames: List[String]): Unit = { + def compile(fileNames: List[String]): Unit = try { val sources = fileNames map getSource compileSources(sources) + } catch { + case NonFatal(ex) => + println(s"exception occurred while compiling $units%, %") + throw ex } /** TODO: There's a fundamental design problem here: We assmble phases using `squash`