summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-02-01 09:18:15 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-02-01 09:18:15 -0800
commit5b4a71eda1df7d914da8d65cfa750bb5e408ca84 (patch)
treede4fceb02a2631962ad75ca247d69976a01c42a9
parentdccf284867bc824c560d19d71e86b796fe320d90 (diff)
parentb5e13c92691d3269fec7bcc065c43d85aceac276 (diff)
downloadscala-5b4a71eda1df7d914da8d65cfa750bb5e408ca84.tar.gz
scala-5b4a71eda1df7d914da8d65cfa750bb5e408ca84.tar.bz2
scala-5b4a71eda1df7d914da8d65cfa750bb5e408ca84.zip
Merge pull request #3424 from som-snytt/issue/7322
SI-7322 Interpolator idents must be encoded
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala2
-rw-r--r--test/files/pos/t7322.scala11
2 files changed, 12 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 23a2e0b37f..e3d2bf14a0 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -1225,7 +1225,7 @@ self =>
// Like Swiss cheese, with holes
def stringCheese: Tree = atPos(in.offset) {
val start = in.offset
- val interpolator = in.name
+ val interpolator = in.name.encoded // ident() for INTERPOLATIONID
val partsBuf = new ListBuffer[Tree]
val exprBuf = new ListBuffer[Tree]
diff --git a/test/files/pos/t7322.scala b/test/files/pos/t7322.scala
new file mode 100644
index 0000000000..006bf89e9f
--- /dev/null
+++ b/test/files/pos/t7322.scala
@@ -0,0 +1,11 @@
+
+package object t7322 {
+ implicit class X(sc: StringContext) {
+ def x_?(args: Any*) = "hi there"
+ }
+}
+package t7322 {
+ trait Y {
+ x_?"junk" // assume that if it compiles, it works
+ }
+}