diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-07-17 11:40:27 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-07-17 15:51:20 +0200 |
commit | 1f1c131bb3ba1f63a90aca89153353cba2693fba (patch) | |
tree | 653cff45365d80d61615392e246c41c1353af745 | |
parent | dc955c9c51d22e0dd3264130712e865aba5f47fb (diff) | |
download | scala-1f1c131bb3ba1f63a90aca89153353cba2693fba.tar.gz scala-1f1c131bb3ba1f63a90aca89153353cba2693fba.tar.bz2 scala-1f1c131bb3ba1f63a90aca89153353cba2693fba.zip |
Reduce Context iface: inline internally.
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 56f945623b..f3c337f633 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -389,13 +389,14 @@ trait Contexts { self: Analyzer => // first attempt fails we try with implicits on *and* clean // buffer but that would also flush any pre-tryTwice valid // errors, hence some manual buffer tweaking is necessary. - val errorsToRestore = flushAndReturnBuffer() + val errorsToRestore = reportBuffer.errors + reportBuffer.clearAllErrors() try { withImplicitsDisabled(tryOnce(false)) - if (hasErrors) { + if (reportBuffer.hasErrors) { fallback = true contextMode = savedContextMode - flushBuffer() + reportBuffer.clearAllErrors() tryOnce(true) } } catch { @@ -405,7 +406,7 @@ trait Contexts { self: Analyzer => if (!fallback) tryOnce(true) else () } finally { contextMode = savedContextMode - updateBuffer(errorsToRestore) + reportBuffer ++= errorsToRestore } } else tryOnce(true) @@ -453,7 +454,7 @@ trait Contexts { self: Analyzer => @inline final def inSilentMode(expr: => Boolean): Boolean = { withMode() { // withMode with no arguments to restore the mode mutated by `setBufferErrors`. setBufferErrors() - try expr && !hasErrors + try expr && !reportBuffer.hasErrors finally reportBuffer.clearAll() } } |