Skip to content

Commit aa135e9

Browse files
Add more docs
1 parent ee16845 commit aa135e9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ class Staging extends MacroTransformWithImplicits {
441441
val hole = makeHole(body1, quotes, tpe).withPos(splice.pos)
442442
// We do not place add the inline marker for trees that where lifted as they come from the same file as their
443443
// enclosing quote. Any intemediate splice will add it's own Inlined node and cancel it before splicig the lifted tree.
444+
// Note that lifted trees are not necessarily expressions and that Inlined nodes are expected to be expressions.
445+
// For example we can have a lifted tree containing the LHS of an assignment (see tests/run-with-compiler/quote-var.scala).
444446
if (splice.isType || outer.embedded.isLiftedSymbol(splice.qualifier.symbol)) hole
445447
else Inlined(EmptyTree, Nil, hole)
446448
}

0 commit comments

Comments
 (0)