diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-04-21 12:47:23 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-04-21 19:12:43 +0200 |
commit | 648784cdf7918ec581051c9df5ffd1a137cb8a5a (patch) | |
tree | 6863aec4bc24166a8ed231c86d50fcea1de0f8d9 | |
parent | c598e764b91307587388ab2a3f5188e64f42af44 (diff) | |
download | scala-648784cdf7918ec581051c9df5ffd1a137cb8a5a.tar.gz scala-648784cdf7918ec581051c9df5ffd1a137cb8a5a.tar.bz2 scala-648784cdf7918ec581051c9df5ffd1a137cb8a5a.zip |
SI-7345 Address review comments.
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index bcc6f8eed6..6daa00e7f8 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -138,11 +138,11 @@ trait Contexts { self: Analyzer => * * More on error buffering: * When are type errors recoverable? In quite a few places, it turns out. Some examples: - * trying to type an application with/without the expected type, or with.without implicit views - * enabled. This is usually mediated by in `Typer.silent`, `Inferencer#tryTwice`. + * trying to type an application with/without the expected type, or with/without implicit views + * enabled. This is usually mediated by `Typer.silent`, `Inferencer#tryTwice`. * - * Intially, starting from the `typer` phase, the contexts either either buffer or report errors; - * from `erasure` errors are thrown. This is configured in `rootContext`. Additionally, more + * Intially, starting from the `typer` phase, the contexts either buffer or report errors; + * afterwards errors are thrown. This is configured in `rootContext`. Additionally, more * fine grained control is needed based on the kind of error; ambiguity errors are often * suppressed during exploraratory typing, such as determining whether `a == b` in an argument * position is an assignment or a named argument, when `Infererencer#isApplicableSafe` type checks @@ -273,11 +273,9 @@ trait Contexts { self: Analyzer => def savingUndeterminedTypeParams[A](reportAmbiguous: Boolean = ambiguousErrors)(body: => A): A = { withMode() { this(AmbiguousErrors) = reportAmbiguous - val savedParams = extractUndetparams() + val saved = extractUndetparams() try body - finally { - undetparams = savedParams - } + finally undetparams = saved } } @@ -1328,7 +1326,8 @@ object ContextMode { /** Are we in a run of [[scala.tools.nsc.typechecker.TreeCheckers]]? */ final val Checking: ContextMode = 1 << 9 - // TODO harvest documentation for this + /** Are we retypechecking arguments independently from the function applied to them? See `Typer.tryTypedApply` */ + // TODO This seems to directly overlap with Mode.SNDTRYmode final val ReTyping: ContextMode = 1 << 10 final val DefaultMode: ContextMode = MacrosEnabled |