summaryrefslogtreecommitdiff
path: root/test/files/run/dynamic-selectDynamic.scala
diff options
context:
space:
mode:
authorSimon Schaefer <mail@antoras.de>2013-11-23 23:45:59 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-11-26 18:57:47 +0100
commitb915f440eb3738d2991b1f96b7c810cc87b88d0c (patch)
tree9934ec7d3e2596e64f71fd16c30c48dcf83b1c39 /test/files/run/dynamic-selectDynamic.scala
parent2ad9666ce8863814dd5d27f1d43739e89c8c286b (diff)
downloadscala-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 'test/files/run/dynamic-selectDynamic.scala')
-rw-r--r--test/files/run/dynamic-selectDynamic.scala25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/files/run/dynamic-selectDynamic.scala b/test/files/run/dynamic-selectDynamic.scala
new file mode 100644
index 0000000000..bd6c138c50
--- /dev/null
+++ b/test/files/run/dynamic-selectDynamic.scala
@@ -0,0 +1,25 @@
+import scala.tools.partest.DirectTest
+
+object Test extends DirectTest {
+
+ override def extraSettings: String =
+ s"-usejavacp -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}"
+
+ override def code = """
+ object X {
+ val d = new D
+ d.field
+ }
+ """.trim
+
+ override def show(): Unit = {
+ Console.withErr(System.out) {
+ compile()
+ }
+ }
+}
+
+import language.dynamics
+class D extends Dynamic {
+ def selectDynamic(name: String) = ???
+}