diff options
author | Martin Odersky <odersky@gmail.com> | 2010-01-22 16:50:55 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2010-01-22 16:50:55 +0000 |
commit | ac9fb6ad28b88ee4e7896c93d26c76e80bd3ece3 (patch) | |
tree | 7f20bbda87a04c390c3fdf154643b4d7065b0cf8 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 1ab0d9ea486254cc2093bba687b7c9b24bcf23da (diff) | |
download | scala-ac9fb6ad28b88ee4e7896c93d26c76e80bd3ece3.tar.gz scala-ac9fb6ad28b88ee4e7896c93d26c76e80bd3ece3.tar.bz2 scala-ac9fb6ad28b88ee4e7896c93d26c76e80bd3ece3.zip |
Second attempt to fix #2926.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 3ef6f3165e..3fd1c2f36b 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2076,17 +2076,6 @@ trait Typers { self: Analyzer => def includesTargetPos(tree: Tree) = tree.pos.isRange && context.unit != null && (tree.pos includes context.unit.targetPos) val localTarget = stats exists includesTargetPos - val companionOfTarget: Option[Tree] = - if (localTarget) { - stats span (!includesTargetPos(_)) match { - case (pre, (cd: ClassDef) :: _) if cd.symbol hasFlag CASE => - pre find { - case md: ModuleDef => md.symbol.name == cd.symbol.name - case _ => false - } - case _ => None - } - } else None def typedStat(stat: Tree): Tree = { if (context.owner.isRefinementClass && !treeInfo.isDeclaration(stat)) errorTree(stat, "only declarations allowed here") @@ -2101,7 +2090,7 @@ trait Typers { self: Analyzer => } else EmptyTree case _ => - if (localTarget && !includesTargetPos(stat) && companionOfTarget != Some(stat)) { + if (localTarget && !includesTargetPos(stat)) { stat } else { val localTyper = if (inBlock || (stat.isDef && !stat.isInstanceOf[LabelDef])) this |