diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-04-01 11:37:57 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-04-15 14:27:04 +0200 |
commit | ef04619e3032dd513bf2e219a03ecf53e8dc8ce6 (patch) | |
tree | 37a3f2ef41364c57ad350c07a89912f09ce91dcc /src/compiler/scala/tools/nsc/typechecker/Contexts.scala | |
parent | fc65423d8d6a7548393d212e17c8563cf40bcfc0 (diff) | |
download | scala-ef04619e3032dd513bf2e219a03ecf53e8dc8ce6.tar.gz scala-ef04619e3032dd513bf2e219a03ecf53e8dc8ce6.tar.bz2 scala-ef04619e3032dd513bf2e219a03ecf53e8dc8ce6.zip |
SI-7319 Clear error buffer during Typer reset.
Contexts share error/warning buffers with their
children, and this also applies ot the shared
`startContext`.
That context flushes the buffers in `startContext`
in `resetContexts`.
It also removes `typerReportAnyContextErrors`, which
appears to be an elaborate no-op. It is only ever passed
a context `c` which is a direct child of `this.context`.
So taking a buffered error out of `c` and reissuing it
into `this.context` merely re-inserts into into the same
error buffer. Consrast this with `silent`, which uses
a child context with a fresh error buffer.
SI-7319 Flush error buffer in typerReportAnyContextErrors.
After this change, we no longer rely on the backstop in resetContexts
introduced in the previous commit.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index f2a2ef4d61..6c2945cad3 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -84,6 +84,8 @@ trait Contexts { self: Analyzer => case Import(qual, _) => qual.tpe = singleType(qual.symbol.owner.thisType, qual.symbol) case _ => } + sc.flushAndReturnBuffer() + sc.flushAndReturnWarningsBuffer() sc = sc.outer } } |