diff --git a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala index fb9176526e42..7c59f23d49e2 100644 --- a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala +++ b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala @@ -53,7 +53,7 @@ trait QuotesAndSplices { report.error(em"Quotes require stable Quotes, but found non stable $quotes", quotes.srcPos) if ctx.mode.is(Mode.Pattern) then - typedQuotePattern(tree, pt, quotes).withSpan(tree.span) + PrepareInlineable.makeInlineable(typedQuotePattern(tree, pt, quotes).withSpan(tree.span)) else if tree.isTypeQuote then val msg = em"""Quoted types `'[..]` can only be used in patterns. | diff --git a/tests/pos-macros/i15676/Macro_1.scala b/tests/pos-macros/i15676/Macro_1.scala new file mode 100644 index 000000000000..361adaaa340b --- /dev/null +++ b/tests/pos-macros/i15676/Macro_1.scala @@ -0,0 +1,14 @@ +package foo + +import scala.quoted.* + +private[foo] object Foo: + def apply(): Int = ??? + +inline def test(): Unit = ${ testExpr() } + +private def testExpr()(using Quotes): Expr[Unit] = { + '{ Foo() } match + case '{ Foo() } => + '{} +} diff --git a/tests/pos-macros/i15676/Test_2.scala b/tests/pos-macros/i15676/Test_2.scala new file mode 100644 index 000000000000..9e45846ff8dc --- /dev/null +++ b/tests/pos-macros/i15676/Test_2.scala @@ -0,0 +1 @@ +def Test() = foo.test()