diff options
author | Miles Sabin <miles@milessabin.com> | 2009-06-01 13:16:13 +0000 |
---|---|---|
committer | Miles Sabin <miles@milessabin.com> | 2009-06-01 13:16:13 +0000 |
commit | 26e953fc6b6295be28e3dc6558c3d76270bae877 (patch) | |
tree | 934705c895b2aa1cbd013d27e392988b5edb1e05 | |
parent | c7aa8f5778d682f169e1943330e97b7d38a41f2e (diff) | |
download | scala-26e953fc6b6295be28e3dc6558c3d76270bae877.tar.gz scala-26e953fc6b6295be28e3dc6558c3d76270bae877.tar.bz2 scala-26e953fc6b6295be28e3dc6558c3d76270bae877.zip |
Unpositionable children don't contribute to par...
Unpositionable children don't contribute to parents position; the
typechecker shouldn't swallow interactive control exceptions.
-rwxr-xr-x | src/compiler/scala/tools/nsc/interactive/Positions.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Positions.scala b/src/compiler/scala/tools/nsc/interactive/Positions.scala index 9982e14815..2eaf32f6db 100755 --- a/src/compiler/scala/tools/nsc/interactive/Positions.scala +++ b/src/compiler/scala/tools/nsc/interactive/Positions.scala @@ -148,9 +148,9 @@ self: Global => tree setPos OffsetPosition(pos.source.get, currentPos.start) else { setChildrenPos(currentPos, children) - // temporary hack to work around issues with implicit resolution + val positionableChildren = children filter (isPositionable(_)) tree setPos new RangePosition( - pos.source.get, (children map (_.pos.start)).min, pos.point, (children map (_.pos.end)).max) + pos.source.get, (positionableChildren map (_.pos.start)).min, pos.point, (positionableChildren map (_.pos.end)).max) } currentPos = new RangePosition(pos.source.get, tree.pos.end, pos.point, pos.end) } diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 4e4f75a4cb..02f6d20522 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3708,6 +3708,8 @@ trait Typers { self: Analyzer => * @return ... */ def typed(tree: Tree, mode: Int, pt: Type): Tree = { + import scala.tools.nsc.interactive.CompilerControl + def dropExistential(tp: Type): Type = tp match { case ExistentialType(tparams, tpe) => if (settings.debug.value) println("drop ex "+tree+" "+tp) @@ -3738,6 +3740,7 @@ trait Typers { self: Analyzer => if (phase.id == currentRun.typerPhase.id) signalDone(context.asInstanceOf[analyzer.Context], tree, result) result } catch { + case ex: CompilerControl#FreshRunReq => throw ex case ex: TypeError => tree.tpe = null //Console.println("caught "+ex+" in typed");//DEBUG |