File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,10 @@ trait QuotesAndSplices {
229
229
}
230
230
}
231
231
cpy.AppliedTypeTree (tree)(transform(tpt), args1)
232
+ case tree : NamedDefTree =>
233
+ if tree.isTerm && ! tree.nameSpan.isSynthetic && tree.symbol.name.startsWith(" $" ) then
234
+ ctx.error(" Names cannot start with $ quote pattern" , ctx.source.atSpan(tree.nameSpan))
235
+ super .transform(tree)
232
236
case _ =>
233
237
super .transform(tree)
234
238
}
Original file line number Diff line number Diff line change
1
+ import scala .quoted ._
2
+
3
+ object FunObject {
4
+ def fun (t : String => String ) = t
5
+ }
6
+
7
+ def test (using QuoteContext )(x : Expr [String => String ]) =
8
+ x match
9
+ case ' { FunObject .fun(($arg : String ) => $out) } => // error
You can’t perform that action at this time.
0 commit comments