@@ -80,8 +80,6 @@ class ReifyQuotes extends MacroTransformWithImplicits {
80
80
new Reifier (inQuote = false , null , 0 , new LevelInfo , new Embedded , ctx)
81
81
82
82
private class LevelInfo {
83
- /** A map from locally defined symbols to the staging levels of their definitions */
84
- val levelOf = new mutable.HashMap [Symbol , Int ]
85
83
86
84
/** Register a reference defined in a quote but used in another quote nested in a splice.
87
85
* Returns a version of the reference that needs to be used in its place.
@@ -119,9 +117,6 @@ class ReifyQuotes extends MacroTransformWithImplicits {
119
117
val nestedEmbedded = if (level > 1 || (level == 1 && isQuote)) embedded else new Embedded
120
118
new Reifier (isQuote, this , if (isQuote) level + 1 else level - 1 , levels, nestedEmbedded, ctx)
121
119
}
122
- //
123
- // /** We are in a `~(...)` context that is not shadowed by a nested `'(...)` */
124
- // def inSplice: Boolean = outer != null && !inQuote
125
120
126
121
/** A stack of entered symbols, to be unwound after scope exit */
127
122
var enteredSyms : List [Symbol ] = Nil
@@ -130,8 +125,7 @@ class ReifyQuotes extends MacroTransformWithImplicits {
130
125
def markDef (tree : Tree )(implicit ctx : Context ): Unit = tree match {
131
126
case tree : DefTree =>
132
127
val sym = tree.symbol
133
- if ((sym.isClass || ! sym.maybeOwner.isType) && ! levelOf.contains(sym)) {
134
- levelOf(sym) = level
128
+ if ((sym.isClass || ! sym.maybeOwner.isType)) {
135
129
enteredSyms = sym :: enteredSyms
136
130
}
137
131
case _ =>
@@ -311,7 +305,7 @@ class ReifyQuotes extends MacroTransformWithImplicits {
311
305
312
306
/** Returns true if this tree will be captured by `makeLambda`. Checks phase consistency and presence of capturer. */
313
307
private def isCaptured (sym : Symbol , level : Int )(implicit ctx : Context ): Boolean =
314
- level == 1 && levelOf.get(sym).contains( 1 ) && capturers.contains(sym)
308
+ level == 1 && capturers.contains(sym)
315
309
316
310
/** Transform `tree` and return the resulting tree and all `embedded` quotes
317
311
* or splices as a pair, after performing the `addTags` transform.
@@ -335,7 +329,6 @@ class ReifyQuotes extends MacroTransformWithImplicits {
335
329
try super .transform(tree)
336
330
finally
337
331
while (enteredSyms ne lastEntered) {
338
- levelOf -= enteredSyms.head
339
332
enteredSyms = enteredSyms.tail
340
333
}
341
334
tree match {
0 commit comments