File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+
3+ def f (foo : Any => Any )(using Quotes ): Expr [Any ] =
4+ ' { println($ { foo[Int ](' {??? }); ??? }) } // error
Original file line number Diff line number Diff line change 1+ package x
2+
3+ import scala .quoted ._
4+
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+ }
You can’t perform that action at this time.
0 commit comments