@@ -36,7 +36,7 @@ import scala.annotation.constructorOnly
36
36
* val x1 = ???
37
37
* val x2 = ???
38
38
* ...
39
- * ~ { ... '{ ... x1 ... x2 ...} ... }
39
+ * $ { ... '{ ... x1 ... x2 ...} ... }
40
40
* ...
41
41
* }
42
42
* ```
@@ -56,12 +56,12 @@ import scala.annotation.constructorOnly
56
56
* val x1$1 = args(0).asInstanceOf[Expr[T]]
57
57
* val x2$1 = args(1).asInstanceOf[Expr[T]] // can be asInstanceOf[Type[T]]
58
58
* ...
59
- * { ... '{ ... x1$1.unary_~ ... x2$1.unary_~ ...} ... }
59
+ * { ... '{ ... ${ x1$1} ... ${ x2$1} ...} ... }
60
60
* }
61
61
* )
62
62
* )
63
63
* ```
64
- * and then performs the same transformation on `'{ ... x1$1.unary_~ ... x2$1.unary_~ ...}`.
64
+ * and then performs the same transformation on `'{ ... ${ x1$1} ... ${ x2$1} ...}`.
65
65
*
66
66
*/
67
67
class ReifyQuotes extends MacroTransform {
@@ -95,9 +95,9 @@ class ReifyQuotes extends MacroTransform {
95
95
* Returns a version of the reference that needs to be used in its place.
96
96
* '{
97
97
* val x = ???
98
- * { ... '{ ... x ... } ... }.unary_~
98
+ * $ { ... '{ ... x ... } ... }
99
99
* }
100
- * Eta expanding the `x` in `{ ... '{ ... x ... } ... }.unary_~ ` will return a `x$1.unary_~ ` for which the `x$1`
100
+ * Eta expanding the `x` in `$ { ... '{ ... x ... } ... }` will return a `${ x$1} ` for which the `x$1`
101
101
* be created by some outer reifier.
102
102
* This transformation is only applied to definitions at staging level 1.
103
103
* See `isCaptured`.
@@ -113,11 +113,11 @@ class ReifyQuotes extends MacroTransform {
113
113
new QuoteReifier (this , capturers, nestedEmbedded, ctx.owner)(ctx)
114
114
}
115
115
116
- /** Assuming <expr> contains types `<tag1>.unary_~ , ..., <tagN>.unary_~ `, the expression
116
+ /** Assuming <expr> contains types `${ <tag1>} , ..., ${ <tagN>} `, the expression
117
117
*
118
- * { type <Type1> = <tag1>.unary_~
118
+ * { type <Type1> = ${ <tag1>}
119
119
* ...
120
- * type <TypeN> = <tagN>.unary_~
120
+ * type <TypeN> = ${ <tagN>}
121
121
* <expr>
122
122
* }
123
123
*
@@ -133,7 +133,7 @@ class ReifyQuotes extends MacroTransform {
133
133
val alias = ctx.typeAssigner.assignType(untpd.TypeBoundsTree (rhs, rhs), rhs, rhs)
134
134
val local = ctx.newSymbol(
135
135
owner = ctx.owner,
136
- name = UniqueName .fresh((splicedTree.symbol.name.toString + " $_~ " ).toTermName).toTypeName,
136
+ name = UniqueName .fresh((splicedTree.symbol.name.toString + " $_" ).toTermName).toTypeName,
137
137
flags = Synthetic ,
138
138
info = TypeAlias (splicedTree.tpe.select(tpnme.splice)),
139
139
coord = spliced.termSymbol.coord).asType
@@ -178,7 +178,7 @@ class ReifyQuotes extends MacroTransform {
178
178
else body match {
179
179
case body : RefTree if isCaptured(body.symbol, level + 1 ) =>
180
180
// Optimization: avoid the full conversion when capturing `x`
181
- // in '{ x } to '{ x$1.unary_~ } and go directly to `x$1`
181
+ // in '{ x } to '{ ${ x$1} } and go directly to `x$1`
182
182
capturers(body.symbol)(body)
183
183
case _=>
184
184
val (body1, splices) = nested(isQuote = true ).splitQuote(body)(quoteContext)
@@ -246,15 +246,15 @@ class ReifyQuotes extends MacroTransform {
246
246
* '{
247
247
* val x = ???
248
248
* val y = ???
249
- * { ... '{ ... x .. y ... } ... }.unary_~
249
+ * $ { ... '{ ... x .. y ... } ... }
250
250
* }
251
251
* then the spliced subexpression
252
252
* { ... '{ ... x ... y ... } ... }
253
253
* will be transformed to
254
254
* (args: Seq[Any]) => {
255
255
* val x$1 = args(0).asInstanceOf[Expr[Any]] // or .asInstanceOf[Type[Any]]
256
256
* val y$1 = args(1).asInstanceOf[Expr[Any]] // or .asInstanceOf[Type[Any]]
257
- * { ... '{ ... x$1.unary_~ ... y$1.unary_~ ... } ... }
257
+ * { ... '{ ... ${ x$1} ... ${ y$1} ... } ... }
258
258
* }
259
259
*
260
260
* See: `capture`
@@ -347,7 +347,7 @@ class ReifyQuotes extends MacroTransform {
347
347
reporting.trace(i " Reifier.transform $tree at $level" , show = true ) {
348
348
tree match {
349
349
case TypeApply (Select (spliceTree @ Spliced (_), _), tp) if tree.symbol.isTypeCast =>
350
- // Splice term which should be in the form `x.unary_~. asInstanceOf[T]` where T is an artefact of
350
+ // Splice term which should be in the form `${x}. asInstanceOf[T]` where T is an artifact of
351
351
// typer to allow pickling/unpickling phase consistent types
352
352
transformSplice(spliceTree)
353
353
0 commit comments