Closed
Description
I have tried to run an example from the Principled Meta Programming doc page.
- It seems that some import is missing to compile with the
showExpr
call. - Even after successful compilation without that call I cannot use the
assert
macro:
andriy@notebook:~/Downloads/dotty-0.10.0/bin$ ./dotr
Starting dotty REPL...
scala> import scala.quoted._
|
| inline def assert(expr: => Boolean): Unit =
| ~ assertImpl('(expr))
|
| def assertImpl(expr: Expr[Boolean]) =
| '{ if !(~expr) then throw new AssertionError("failed assertion")}
def assert(expr: => Boolean): Unit
def assertImpl(expr: quoted.Expr[Boolean]): quoted.Expr[Unit]
scala> assert(0 == 0)
1 |assert(0 == 0)
|^^^^^^^^^^^^^^
|Could not find macro class rs$line$1$ in classpath. The most common reason for that is that you apply macros in the compilation run that defines them