Skip to content

Commit 33796da

Browse files
authored
Add note of separate compilation unit in macro's code example
1 parent 297e9fc commit 33796da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/docs/reference/principled-meta-programming.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ program that calls `assert`.
321321
def assertImpl(expr: Expr[Boolean]) =
322322
'{ if !(~expr) then throw new AssertionError(s"failed assertion: ${~expr}") }
323323
}
324-
324+
325+
// has to be in different compilation unit
325326
val program = {
326327
val x = 1
327328
Macros.assert(x != 0)

0 commit comments

Comments
 (0)