Skip to content

Commit 5b4a71e

Browse files
committed
Merge pull request scala#3424 from som-snytt/issue/7322
SI-7322 Interpolator idents must be encoded
2 parents dccf284 + b5e13c9 commit 5b4a71e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/compiler/scala/tools/nsc/ast/parser/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ self =>
12251225
// Like Swiss cheese, with holes
12261226
def stringCheese: Tree = atPos(in.offset) {
12271227
val start = in.offset
1228-
val interpolator = in.name
1228+
val interpolator = in.name.encoded // ident() for INTERPOLATIONID
12291229

12301230
val partsBuf = new ListBuffer[Tree]
12311231
val exprBuf = new ListBuffer[Tree]

test/files/pos/t7322.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
package object t7322 {
3+
implicit class X(sc: StringContext) {
4+
def x_?(args: Any*) = "hi there"
5+
}
6+
}
7+
package t7322 {
8+
trait Y {
9+
x_?"junk" // assume that if it compiles, it works
10+
}
11+
}

0 commit comments

Comments
 (0)