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.
2 parents 65900c0 + fb23568 commit ebaceb8Copy full SHA for ebaceb8
tests/neg-macros/i14123a.scala
@@ -0,0 +1,4 @@
1
+import scala.quoted._
2
+
3
+def f(foo: Any => Any)(using Quotes): Expr[Any] =
4
+ '{ println(${ foo[Int]('{???}); ??? }) } // error
tests/neg-macros/i14123b.scala
@@ -0,0 +1,23 @@
+package x
5
+object Impl {
6
7
+ sealed trait UpdateOp[+T]
8
+ case class Assignment[T](value:Expr[T]) extends UpdateOp[T]
9
+ case class Update(operation:Expr[Unit]) extends UpdateOp[Nothing]
10
11
+ def genRead[B:Type](newBuilder: Expr[B],
12
+ readVal: (Expr[B]) => UpdateOp[B]
13
+ )(using Quotes): Expr[B] =
14
+ '{
15
+ var x = $newBuilder
16
+ ${readVal[B]('x) match { // error: method apply in trait Function1 does not take type parameters
17
+ case Assignment(value) => '{ x = $value } // error
18
+ case Update(operation) => operation // error
19
+ }}
20
+ x
21
+ }
22
23
+}
0 commit comments