Skip to content

Commit a35d1bc

Browse files
committed
Fix inline methods returning a top level quote with an nested splice
Now that these methods are not wrongly tagged as macros the top level quote needs to be reified. See tests/pos/quoted-inline-quote.scala
1 parent b5fd1b9 commit a35d1bc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,13 @@ class ReifyQuotes extends MacroTransform {
182182
capturers(body.symbol)(body)
183183
case _=>
184184
val (body1, splices) = nested(isQuote = true).splitQuote(body)(quoteContext)
185-
if (level == 0 && !ctx.inInlineMethod) {
185+
if (level == 0) {
186186
val body2 =
187187
if (body1.isType) body1
188188
else Inlined(Inliner.inlineCallTrace(ctx.owner, quote.sourcePos), Nil, body1)
189189
pickledQuote(body2, splices, body.tpe, isType).withSpan(quote.span)
190190
}
191191
else {
192-
// In top-level splice in an inline def. Keep the tree as it is, it will be transformed at inline site.
193192
body
194193
}
195194
}

0 commit comments

Comments
 (0)