Actually that's a different problem, and I created a bug for it:
https://issues.scala-lang.org/browse/SI-7331
> On 4 April 2013 23:34, Simon Schäfer <
m...@antoras.de> wrote:
>
>
>
>
>
>
>
> > I tried to implement semantic highlighting for calls to scala.Dynamic in
> > the Scala IDE. But I didn't came up with the correct position objects for
> > the transformations.
>
> > I looked in detail only to selectDynamic yet, thus the following may be
> > true for the other dynamic methods as well.
>
> > It seems that after a transformation of `d.foo` to
> > `d.selectDynamic("foo")` the string literal points to the same location as
> > the identifier `d`.
>
> > I can't reproduce the behavior in the REPL, I always get NoPosition after
> > creating an AST with reify or ToolBox (see code below).
>
> > The IDE still works with 2.10, and I have no idea how to get an AST
> > otherwise, thus I can't test if the behavior is different in 2.11.
>
> > The behavior seems to be a bug, it should point to the `foo` field call
> > before the transformation, is that correct? If yes, I'm interested in
> > fixing it (if no one else has the time to do it).
>
> > Any hints where to start searching for the bug. I assume it is somewhere
> > in Typers.
>
> > And is it possible to typecheck a string (or a file) in the REPL with
> > correct Positions?
>
> > The code used to find positions in the REPL:
>
> > import reflect.runtime.universe._
> > import scala.reflect.runtime.{**currentMirror => m}
> > import scala.tools.reflect.ToolBox
>
> > /*
> > val in = reify{object X {
> > D.foo
> > import language.dynamics
> > object D extends Dynamic { def selectDynamic(s: String) = s }
> > }}
> > val Block(List(ModuleDef(_, _, Template(_, _, _ :: Apply(_, List(lit:
> > Literal)) :: _))), _) = in.tree
> > */
>
> > val tb = m.mkToolBox()
>
> > val in = """object X {
> > D.foo
> > import language.dynamics
> > object D extends Dynamic { def selectDynamic(s: String) = s }
> > }"""
>
> > val tree = tb.typeCheck(tb.parse(in))
> > val ModuleDef(_, _, Template(_, _, _ :: Apply(_, List(lit: Literal)) ::
> > _)) = tree
>
> > lit.pos == NoPosition
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "scala-internals" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to scala-internals+unsubscribe@**
googlegroups.com<
scala-internals%2Bunsu...@googlegroups.com>
> > .
> > For more options, visithttps://
groups.google.com/**groups/opt_out<
https://groups.google.com/groups/opt_out>
> > .