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 {
43
43
def typedQuote (tree : untpd.Quote , pt : Type )(using Context ): Tree = {
44
44
record(" typedQuote" )
45
45
tree.quoted match {
46
- case untpd.Splice (innerExpr) if tree.isTerm =>
46
+ case untpd.Splice (innerExpr) if tree.isTerm && ! ctx.mode.is( Mode . Pattern ) =>
47
47
report.warning(" Canceled splice directly inside a quote. '{ ${ XYZ } } is equivalent to XYZ." , tree.srcPos)
48
48
case untpd.TypSplice (innerType) if tree.isType =>
49
49
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