File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
compiler/src/dotty/tools/dotc/typer
tests/pos-special/fatal-warnings Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ trait QuotesAndSplices {
4343 def typedQuote (tree : untpd.Quote , pt : Type )(using Context ): Tree = {
4444 record(" typedQuote" )
4545 tree.quoted match {
46- case untpd.Splice (innerExpr) if tree.isTerm =>
46+ case untpd.Splice (innerExpr) if tree.isTerm && ! ctx.mode.is( Mode . Pattern ) =>
4747 report.warning(" Canceled splice directly inside a quote. '{ ${ XYZ } } is equivalent to XYZ." , tree.srcPos)
4848 case untpd.TypSplice (innerType) if tree.isType =>
4949 report.warning(" Canceled splice directly inside a quote. '[ ${ XYZ } ] is equivalent to XYZ." , tree.srcPos)
Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+
3+ def f [A : Type ](e : Expr [A ])(using Quotes ): Expr [A ] = e match {
4+ case ' { $e2 } => e2
5+ }
You can’t perform that action at this time.
0 commit comments