From b915f440eb3738d2991b1f96b7c810cc87b88d0c Mon Sep 17 00:00:00 2001 From: Simon Schaefer Date: Sat, 23 Nov 2013 23:45:59 +0100 Subject: 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. --- test/files/run/dynamic-applyDynamic.scala | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/files/run/dynamic-applyDynamic.scala (limited to 'test/files/run/dynamic-applyDynamic.scala') diff --git a/test/files/run/dynamic-applyDynamic.scala b/test/files/run/dynamic-applyDynamic.scala new file mode 100644 index 0000000000..b06041194c --- /dev/null +++ b/test/files/run/dynamic-applyDynamic.scala @@ -0,0 +1,26 @@ +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.method(10) + d(10) + } + """.trim + + override def show(): Unit = { + Console.withErr(System.out) { + compile() + } + } +} + +import language.dynamics +class D extends Dynamic { + def applyDynamic(name: String)(value: Any) = ??? +} \ No newline at end of file -- cgit v1.2.3