We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 755a81f commit 1c2eb3bCopy full SHA for 1c2eb3b
compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala
@@ -229,6 +229,10 @@ trait QuotesAndSplices {
229
}
230
231
cpy.AppliedTypeTree(tree)(transform(tpt), args1)
232
+ case tree: NamedDefTree =>
233
+ if !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)
236
case _ =>
237
super.transform(tree)
238
tests/neg/i8749.scala
@@ -0,0 +1,9 @@
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
0 commit comments