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 a853fe9 commit 93eaaafCopy full SHA for 93eaaaf
tests/pos/quoted.scala
@@ -0,0 +1,25 @@
1
+import scala.quoted._
2
+
3
+class Test {
4
5
+ object Macros {
6
7
+ inline def assert(expr: => Boolean): Unit =
8
+ ~ assertImpl('(expr))
9
10
+ def assertImpl(expr: Expr[Boolean]) =
11
+ '{ if !(~expr) then throw new AssertionError(s"failed assertion: ${~expr}") }
12
13
+ }
14
15
+ val program = '{
16
+ import Macros._
17
18
+ val x = 1
19
+ assert(x != 0)
20
21
+ ~assertImpl('(x != 0))
22
23
24
+ program.run
25
+}
0 commit comments