Skip to content

Commit f8aa9b5

Browse files
committed
Remove root context
1 parent 655a24f commit f8aa9b5

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

compiler/src/dotty/tools/dotc/transform/Staging.scala

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Staging extends MacroTransformWithImplicits {
4949
if (ctx.compilationUnit.needsStaging) super.run
5050

5151
protected def newTransformer(implicit ctx: Context): Transformer =
52-
new Reifier(inQuote = false, null, 0, new LevelInfo, ctx)
52+
new Reifier(inQuote = false, null, 0, new LevelInfo)
5353

5454
private class LevelInfo {
5555
/** A map from locally defined symbols to the staging levels of their definitions */
@@ -63,24 +63,16 @@ class Staging extends MacroTransformWithImplicits {
6363
* The initial level is 0, a level `l` where `l > 0` implies code has been quoted `l` times
6464
* and `l == -1` is code inside a top level splice (in an inline method).
6565
* @param levels a stacked map from symbols to the levels in which they were defined
66-
* @param rctx the contex in the destination lifted lambda
6766
*/
68-
private class Reifier(inQuote: Boolean, val outer: Reifier, val level: Int, levels: LevelInfo,
69-
val rctx: Context) extends ImplicitsTransformer {
67+
private class Reifier(inQuote: Boolean, val outer: Reifier, level: Int, levels: LevelInfo) extends ImplicitsTransformer {
7068
import levels._
7169
assert(level >= -1)
7270

7371
/** A nested reifier for a quote (if `isQuote = true`) or a splice (if not) */
7472
def nested(isQuote: Boolean)(implicit ctx: Context): Reifier = {
75-
new Reifier(isQuote, this, if (isQuote) level + 1 else level - 1, levels, ctx)
73+
new Reifier(isQuote, this, if (isQuote) level + 1 else level - 1, levels)
7674
}
7775

78-
/** We are in a `~(...)` context that is not shadowed by a nested `'(...)` */
79-
def inSplice: Boolean = outer != null && !inQuote
80-
81-
/** We are not in a `~(...)` or a `'(...)` */
82-
def isRoot: Boolean = outer == null
83-
8476
/** A map from type ref T to expressions of type `quoted.Type[T]`".
8577
* These will be turned into splices using `addTags` and represent type variables
8678
* that can be possibly healed.

0 commit comments

Comments
 (0)