diff options
author | Miles Sabin <miles@milessabin.com> | 2009-09-10 18:06:45 +0000 |
---|---|---|
committer | Miles Sabin <miles@milessabin.com> | 2009-09-10 18:06:45 +0000 |
commit | 0250956d2dab3df8d8c72a94fbc886bf655dc690 (patch) | |
tree | c2ae046a69f60deb02c15a39af98d02603c49af0 | |
parent | e934ffb347be4ad52465b3d3cb9398176c7b60da (diff) | |
download | scala-0250956d2dab3df8d8c72a94fbc886bf655dc690.tar.gz scala-0250956d2dab3df8d8c72a94fbc886bf655dc690.tar.bz2 scala-0250956d2dab3df8d8c72a94fbc886bf655dc690.zip |
Make sure that last fix is only applied in inte...
Make sure that last fix is only applied in interactive mode.
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 99b10d766d..fef0dd0282 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3216,14 +3216,21 @@ trait Typers { self: Analyzer => "\npossible cause: maybe a semicolon is missing before `"+decode(name)+"'?" else "")) } - setError(tree) - val tree1 = tree match { - case Select(_, _) => treeCopy.Select(tree, qual, name) - case SelectFromTypeTree(_, _) => treeCopy.SelectFromTypeTree(tree, qual, name) - } - - tree1 + // Temporary workaround to retain type information for qual so that askTypeCompletion has something to + // work with. This appears to work in the context of the IDE, but is incorrect and needs to be + // revisited. + if (onlyPresentation) { + // Nb. this appears to throw away the effects of setError, but some appear to be + // retained across the copy. + setError(tree) + val tree1 = tree match { + case Select(_, _) => treeCopy.Select(tree, qual, name) + case SelectFromTypeTree(_, _) => treeCopy.SelectFromTypeTree(tree, qual, name) + } + tree1 + } else + setError(tree) } else { val tree1 = tree match { case Select(_, _) => treeCopy.Select(tree, qual, name) |