summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-07-20 06:22:07 -0700
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-07-20 06:22:07 -0700
commit952cb61108faf1a68e58ee95460e9b3bcad40ea8 (patch)
tree88ad9adcd429c961b61132390c71670cc314a3f7 /test/files/neg
parent314133f98118d6d2f9f515fcc5aa7a2e7e9a4559 (diff)
parentd06c73c1f381c346b46ca9499fbec8677d3fab5e (diff)
downloadscala-952cb61108faf1a68e58ee95460e9b3bcad40ea8.tar.gz
scala-952cb61108faf1a68e58ee95460e9b3bcad40ea8.tar.bz2
scala-952cb61108faf1a68e58ee95460e9b3bcad40ea8.zip
Merge pull request #927 from dgruntz/issue/5856
SI-5856 enables use of $this in string interpolation
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t5856.check31
-rw-r--r--test/files/neg/t5856.scala11
2 files changed, 42 insertions, 0 deletions
diff --git a/test/files/neg/t5856.check b/test/files/neg/t5856.check
new file mode 100644
index 0000000000..ac49d4b9ac
--- /dev/null
+++ b/test/files/neg/t5856.check
@@ -0,0 +1,31 @@
+t5856.scala:10: error: invalid string interpolation: `$$', `$'ident or `$'BlockExpr expected
+ val s9 = s"$"
+ ^
+t5856.scala:10: error: unclosed string literal
+ val s9 = s"$"
+ ^
+t5856.scala:2: error: error in interpolated string: identifier or block expected
+ val s1 = s"$null"
+ ^
+t5856.scala:3: error: error in interpolated string: identifier or block expected
+ val s2 = s"$false"
+ ^
+t5856.scala:4: error: error in interpolated string: identifier or block expected
+ val s3 = s"$true"
+ ^
+t5856.scala:5: error: error in interpolated string: identifier or block expected
+ val s4 = s"$yield"
+ ^
+t5856.scala:6: error: error in interpolated string: identifier or block expected
+ val s5 = s"$return"
+ ^
+t5856.scala:7: error: error in interpolated string: identifier or block expected
+ val s6 = s"$new"
+ ^
+t5856.scala:8: error: error in interpolated string: identifier or block expected
+ val s7 = s"$s1 $null $super"
+ ^
+t5856.scala:9: error: error in interpolated string: identifier or block expected
+ val s8 = s"$super"
+ ^
+10 errors found
diff --git a/test/files/neg/t5856.scala b/test/files/neg/t5856.scala
new file mode 100644
index 0000000000..2ceee590af
--- /dev/null
+++ b/test/files/neg/t5856.scala
@@ -0,0 +1,11 @@
+object Test {
+ val s1 = s"$null"
+ val s2 = s"$false"
+ val s3 = s"$true"
+ val s4 = s"$yield"
+ val s5 = s"$return"
+ val s6 = s"$new"
+ val s7 = s"$s1 $null $super"
+ val s8 = s"$super"
+ val s9 = s"$"
+} \ No newline at end of file