diff options
author | François Garillot <francois@garillot.net> | 2013-06-21 13:49:37 +0200 |
---|---|---|
committer | François Garillot <francois@garillot.net> | 2013-06-24 12:02:46 +0200 |
commit | 272b165a57d39529a9eb5996bbba64e0c368e43e (patch) | |
tree | a984685d07f1e439e3cc9bdb6ce1ca6b8345b4ac /test/files/run/t7569.scala | |
parent | b29e515205581d58d239464daadf37f0f1537519 (diff) | |
download | scala-272b165a57d39529a9eb5996bbba64e0c368e43e.tar.gz scala-272b165a57d39529a9eb5996bbba64e0c368e43e.tar.bz2 scala-272b165a57d39529a9eb5996bbba64e0c368e43e.zip |
SI-7569 Fix end position in PostfixSelect tree
introduced in 5b54681: the end position of Postfix operators should
take the operator length into account.
review by @som-snytt
Diffstat (limited to 'test/files/run/t7569.scala')
-rw-r--r-- | test/files/run/t7569.scala | 19 |
1 files changed, 19 insertions, 0 deletions
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 _ => + } + } + } +} |