We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 400427d commit e611b33Copy full SHA for e611b33
compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala
@@ -192,7 +192,7 @@ trait QuotesAndSplices {
192
assignType(tree, tpt)
193
194
private def checkSpliceOutsideQuote(tree: untpd.Tree)(using Context): Unit =
195
- if (level == 0 && !ctx.owner.ownersIterator.exists(_.is(Inline)))
+ if (level == 0 && !ctx.owner.ownersIterator.exists(_.isInlineMethod))
196
report.error("Splice ${...} outside quotes '{...} or inline method", tree.srcPos)
197
else if (level < 0)
198
report.error(
tests/neg-macros/i14679.scala
@@ -0,0 +1,7 @@
1
+import scala.quoted.*
2
+
3
+object A {
4
+ inline val a = ${b} // error
5
6
+ def b(using Quotes): Expr[Unit] = '{ () }
7
+}
0 commit comments