Skip to content

Commit b5e13c9

Browse files
committed
SI-7322 Interpolator idents must be encoded
Otherwise, they are not found. This matters for term names with a differential encoding. Footnote, normally ident() encodes, but INTERPOLATIONID is !isIdent, so that is not used here. Maybe that would be the better improvement.
1 parent da929c8 commit b5e13c9

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
@@ -1219,7 +1219,7 @@ self =>
12191219
// Like Swiss cheese, with holes
12201220
def stringCheese: Tree = atPos(in.offset) {
12211221
val start = in.offset
1222-
val interpolator = in.name
1222+
val interpolator = in.name.encoded // ident() for INTERPOLATIONID
12231223

12241224
val partsBuf = new ListBuffer[Tree]
12251225
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)