diff options
author | Dominik Gruntz <dominik.gruntz@fhnw.ch> | 2012-07-17 15:38:58 +0200 |
---|---|---|
committer | Dominik Gruntz <dominik.gruntz@fhnw.ch> | 2012-07-17 15:48:37 +0200 |
commit | 9c4b0d0402559921d4f36e9ebdd1af9a818fdde7 (patch) | |
tree | ba04a2af0e0c83b3a278e69d8efa9389f9031f99 /test/files/run | |
parent | bad93927836f302be3b973335a63bb5e69b2237c (diff) | |
download | scala-9c4b0d0402559921d4f36e9ebdd1af9a818fdde7.tar.gz scala-9c4b0d0402559921d4f36e9ebdd1af9a818fdde7.tar.bz2 scala-9c4b0d0402559921d4f36e9ebdd1af9a818fdde7.zip |
SI-5856 enables use of $this in string interpolation
This pull request fixes SI-5856. The scanner has been modified
to return the correct token if keywords appear in $-expressions.
The parser has been modified to issue an error and to only accept
$<identifier>, $this and $block.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t5856.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/run/t5856.scala b/test/files/run/t5856.scala new file mode 100644 index 0000000000..d1e9bd6e58 --- /dev/null +++ b/test/files/run/t5856.scala @@ -0,0 +1,10 @@ +object Test extends App { + override def toString = "Test" + + assert(s"$this" == "Test") + assert(s"$this$this" == "TestTest") + assert(s"$this$$" == "Test$") + assert(s"$this.##" == "Test.##") + assert(s"$this.toString" == "Test.toString") + assert(s"$this=THIS" == "Test=THIS") +}
\ No newline at end of file |