summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-06-24 06:12:49 -0700
committerJason Zaugg <jzaugg@gmail.com>2013-06-24 06:12:49 -0700
commit0fafce3de7f1adef174a030a14c5d440a7646be1 (patch)
treea984685d07f1e439e3cc9bdb6ce1ca6b8345b4ac /test
parentb29e515205581d58d239464daadf37f0f1537519 (diff)
parent272b165a57d39529a9eb5996bbba64e0c368e43e (diff)
downloadscala-0fafce3de7f1adef174a030a14c5d440a7646be1.tar.gz
scala-0fafce3de7f1adef174a030a14c5d440a7646be1.tar.bz2
scala-0fafce3de7f1adef174a030a14c5d440a7646be1.zip
Merge pull request #2671 from huitseeker/issue/SI-7569
SI-7569 Fix end position in PostfixSelect tree
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t7569.check12
-rw-r--r--test/files/run/t7569.scala19
2 files changed, 31 insertions, 0 deletions
diff --git a/test/files/run/t7569.check b/test/files/run/t7569.check
new file mode 100644
index 0000000000..98513c3ab2
--- /dev/null
+++ b/test/files/run/t7569.check
@@ -0,0 +1,12 @@
+source-newSource1.scala,line-3,offset=49 A.this.one
+source-newSource1.scala,line-3,offset=49 A.this
+source-newSource1.scala,line-4,offset=67 A.super.<init>()
+source-newSource1.scala,line-4,offset=67 A.super.<init>
+source-newSource1.scala,line-4,offset=67 this
+source-newSource1.scala,line-3,offset=49 A.this.one
+source-newSource1.scala,line-3,offset=49 A.this
+RangePosition(newSource1.scala, 55, 57, 65) scala.Int.box(1).toString()
+RangePosition(newSource1.scala, 55, 57, 65) scala.Int.box(1).toString
+RangePosition(newSource1.scala, 55, 55, 56) scala.Int.box(1)
+NoPosition scala.Int.box
+NoPosition scala.Int
diff --git a/test/files/run/t7569.scala b/test/files/run/t7569.scala
new file mode 100644
index 0000000000..b1b1443a18
--- /dev/null
+++ b/test/files/run/t7569.scala
@@ -0,0 +1,19 @@
+import scala.tools.partest._
+object Test extends CompilerTest {
+ import global._
+ override def extraSettings = super.extraSettings + " -Yrangepos"
+ override def sources = List(
+ """|import scala.language.postfixOps
+ |class A {
+ | val one = 1 toString
+ |}""".stripMargin
+ )
+ def check(source: String, unit: CompilationUnit) {
+ for (ClassDef(_, _, _, Template(_, _, stats)) <- unit.body ; stat <- stats ; t <- stat) {
+ t match {
+ case _: Select | _ : Apply | _:This => println("%-15s %s".format(t.pos.toString, t))
+ case _ =>
+ }
+ }
+ }
+}