summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@gmail.com>2012-08-12 14:20:14 +0200
committerHubert Plociniczak <hubert.plociniczak@gmail.com>2012-08-12 17:22:29 +0200
commit21fcf64c8197b481325c3765b897f7159817875c (patch)
tree6df076827f7446b746e9cf45eb7ca1660a128723 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parenta80b538763d88604d93b8c71604042c69e6b1073 (diff)
downloadscala-21fcf64c8197b481325c3765b897f7159817875c.tar.gz
scala-21fcf64c8197b481325c3765b897f7159817875c.tar.bz2
scala-21fcf64c8197b481325c3765b897f7159817875c.zip
Fixes SI-6214.
addSynthetics was calling typedStat that caused flushing error buffer. Typically that would result in errors being re-added but addSynthetics was the last thing to run in typedStats. Instead of adding yet another check I used this as an opportunity to cleanup the once necessary workaround for typing stats. Since we are now chaining buffers of contexts manual handling is no longer necessary. Review by @odersky (I recall that you were planning to cleanup that part at some point).
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index a6d7424837..5bd96d49ce 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2644,7 +2644,6 @@ trait Typers extends Modes with Adaptations with Tags {
def includesTargetPos(tree: Tree) =
tree.pos.isRange && context.unit.exists && (tree.pos includes context.unit.targetPos)
val localTarget = stats exists includesTargetPos
- val statsErrors = scala.collection.mutable.LinkedHashSet[AbsTypeError]()
def typedStat(stat: Tree): Tree = {
if (context.owner.isRefinementClass && !treeInfo.isDeclarationOrTypeDef(stat))
OnlyDeclarationsError(stat)
@@ -2663,7 +2662,6 @@ trait Typers extends Modes with Adaptations with Tags {
stat
} else {
val localTyper = if (inBlock || (stat.isDef && !stat.isInstanceOf[LabelDef])) {
- context.flushBuffer()
this
} else newTyper(context.make(stat, exprOwner))
// XXX this creates a spurious dead code warning if an exception is thrown
@@ -2680,7 +2678,6 @@ trait Typers extends Modes with Adaptations with Tags {
"a pure expression does nothing in statement position; " +
"you may be omitting necessary parentheses"
)
- statsErrors ++= localTyper.context.errBuffer
result
}
}
@@ -2763,12 +2760,7 @@ trait Typers extends Modes with Adaptations with Tags {
}
}
- val stats1 = withSavedContext(context) {
- val result = stats mapConserve typedStat
- context.flushBuffer()
- result
- }
- context.updateBuffer(statsErrors)
+ val stats1 = stats mapConserve typedStat
if (phase.erasedTypes) stats1
else {
checkNoDoubleDefs(stats1)