diff options
author | Paul Phillips <paulp@improving.org> | 2012-08-02 10:07:19 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-08-11 20:27:46 -0700 |
commit | a55788e275faed91cb9223686a3aef6ee54213a8 (patch) | |
tree | 4ac92fc704d7e06edb38680114321309c84dbd5b /src/compiler/scala/tools/nsc/Global.scala | |
parent | 4459e5abb2b765cbdca34eb19c5d8b705203f771 (diff) | |
download | scala-a55788e275faed91cb9223686a3aef6ee54213a8.tar.gz scala-a55788e275faed91cb9223686a3aef6ee54213a8.tar.bz2 scala-a55788e275faed91cb9223686a3aef6ee54213a8.zip |
More resilience to missing classes.
The situation (I don't know how to make partest test this) is
package s
class A ; class S { def f(): A = ??? }
If one compiles this and removes A.class, should references to
class S cause the compiler to explode eagerly and fail to load S,
or explode lazily if and when it needs to know something about A?
This patch takes us from the former strategy to the latter.
Review by @xeno-by.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 2b0f082051..c60a3c941f 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -220,11 +220,11 @@ class Global(var currentSettings: Settings, var reporter: Reporter) // not deprecated yet, but a method called "error" imported into // nearly every trait really must go. For now using globalError. - def error(msg: String) = globalError(msg) - def globalError(msg: String) = reporter.error(NoPosition, msg) - def inform(msg: String) = reporter.echo(msg) - def warning(msg: String) = - if (opt.fatalWarnings) globalError(msg) + def error(msg: String) = globalError(msg) + def inform(msg: String) = reporter.echo(msg) + override def globalError(msg: String) = reporter.error(NoPosition, msg) + override def warning(msg: String) = + if (settings.fatalWarnings.value) globalError(msg) else reporter.warning(NoPosition, msg) // Getting in front of Predef's asserts to supplement with more info. |