File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,16 @@ class ReifyQuotes extends MacroTransform {
62
62
def checkLevel (tree : Tree )(implicit ctx : Context ): Unit = {
63
63
64
64
def check (sym : Symbol , show : Symbol => String ): Unit =
65
- if (levelOf.getOrElse(sym, currentLevel) != currentLevel)
65
+ if (! sym.isStaticOwner &&
66
+ ! ctx.owner.ownersIterator.exists(_.isInlineMethod) &&
67
+ levelOf.getOrElse(sym, currentLevel) != currentLevel)
66
68
ctx.error(em """ access to ${show(sym)} from wrong staging level:
67
69
| - the definition is at level ${levelOf(sym)},
68
70
| - but the access is at level $currentLevel. """ , tree.pos)
69
71
70
- def showThis (sym : Symbol ) = i " ${sym.name}.this "
72
+ def showThis (sym : Symbol ) =
73
+ if (sym.is(ModuleClass )) sym.sourceModule.show
74
+ else i " ${sym.name}.this "
71
75
72
76
val sym = tree.symbol
73
77
if (sym.exists)
@@ -136,6 +140,8 @@ class ReifyQuotes extends MacroTransform {
136
140
levelOf -= enteredSyms.head
137
141
enteredSyms = enteredSyms.tail
138
142
}
143
+ case _ : Import =>
144
+ tree
139
145
case _ =>
140
146
super .transform(tree)
141
147
}
You can’t perform that action at this time.
0 commit comments