Skip to content

Commit f3af5ea

Browse files
committed
Handle patterns at all levels
1 parent af1acc1 commit f3af5ea

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ trait QuotesAndSplices {
5353
ctx.error(em"Quotes require stable QuoteContext, but found non stable $qctx", qctx.sourcePos)
5454

5555
val tree1 =
56-
if ctx.mode.is(Mode.Pattern) && level == 0 then
56+
if ctx.mode.is(Mode.Pattern) then
5757
typedQuotePattern(tree, pt, qctx)
5858
else if (tree.quoted.isType)
5959
typedTypeApply(untpd.TypeApply(untpd.ref(defn.InternalQuoted_typeQuote.termRef), tree.quoted :: Nil), pt)(quoteContext)

tests/neg/i8052.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ object Macro2 {
1111
def derived[T: Type](ev: Expr[Mirror.Of[T]])(using qctx: QuoteContext): Expr[TC[T]] = '{
1212
new TC[T] {
1313
def encode(): Unit = $ev match {
14-
case '{ $m: Mirror.ProductOf[T] } => ??? // error // error
14+
case '{ $m: Mirror.ProductOf[T] } => ??? // error
1515
}
1616
}
1717
}

0 commit comments

Comments
 (0)