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.
2 parents b40b9de + e611b33 commit 95ae793Copy full SHA for 95ae793
compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala
@@ -167,7 +167,7 @@ trait QuotesAndSplices {
167
assignType(tree, tpt)
168
169
private def checkSpliceOutsideQuote(tree: untpd.Tree)(using Context): Unit =
170
- if (level == 0 && !ctx.owner.ownersIterator.exists(_.is(Inline)))
+ if (level == 0 && !ctx.owner.ownersIterator.exists(_.isInlineMethod))
171
report.error("Splice ${...} outside quotes '{...} or inline method", tree.srcPos)
172
else if (level < 0)
173
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