diff options
author | Simon Schaefer <mail@antoras.de> | 2013-11-23 23:45:59 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-11-26 18:57:47 +0100 |
commit | b915f440eb3738d2991b1f96b7c810cc87b88d0c (patch) | |
tree | 9934ec7d3e2596e64f71fd16c30c48dcf83b1c39 /src | |
parent | 2ad9666ce8863814dd5d27f1d43739e89c8c286b (diff) | |
download | scala-b915f440eb3738d2991b1f96b7c810cc87b88d0c.tar.gz scala-b915f440eb3738d2991b1f96b7c810cc87b88d0c.tar.bz2 scala-b915f440eb3738d2991b1f96b7c810cc87b88d0c.zip |
SI-7463,SI-8003 Correct wrong position for {select,apply}Dynamic calls
The new positions are range positions that directly refer to the
beginning and the end of the method calls in the sources instead of
simply point to the beginning of the expression. This allows the
scala-ide to semantically highlight select- and applyDynamic method
calls, because it has only to traverse the tree and apply the color
ranges to the given position ranges.
This also fixes the position marker of an error messages related
to a wrong Dynamic method signature.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 48e7e3a38c..2bbb6d79dd 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -4061,7 +4061,10 @@ trait Typers extends Modes with Adaptations with Tags { case Some((opName, treeInfo.Applied(_, targs, _))) => val fun = gen.mkTypeApply(Select(qual, opName), targs) if (opName == nme.updateDynamic) suppressMacroExpansion(fun) // SI-7617 - atPos(qual.pos)(Apply(fun, Literal(Constant(name.decode)) :: Nil)) + val nameStringLit = atPos(treeSelection.pos.withStart(treeSelection.pos.point).makeTransparent) { + Literal(Constant(name.decode)) + } + atPos(qual.pos)(Apply(fun, List(nameStringLit))) case _ => setError(tree) } |