File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
docs/docs/reference/metaprogramming Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -34,18 +34,18 @@ prints it again in an error message if it evaluates to `false`.
3434 import scala .quoted ._
3535
3636 inline def assert (expr : => Boolean ): Unit =
37- $ { assertImpl(' { expr } ) }
37+ $ { assertImpl(' expr ) }
3838
3939 def assertImpl (expr : Expr [Boolean ]) = ' {
40- if ! ($ { expr } ) then
40+ if ! ($expr) then
4141 throw new AssertionError (s " failed assertion: ${$ { showExpr(expr) }}" )
4242 }
4343
4444 def showExpr (expr : Expr [Boolean ]): Expr [String ] =
4545 ' { " <some source code>" } // Better implementation later in this document
4646```
4747
48- If ` e ` is an expression, then ` '{e} ` represent the typed
48+ If ` e ` is an expression, then ` '{e} ` represents the typed
4949abstract syntax tree representing ` e ` . If ` T ` is a type, then ` '[T] `
5050represents the type structure representing ` T ` . The precise
5151definitions of "typed abstract syntax tree" or "type-structure" do not
@@ -88,7 +88,7 @@ The two types can be defined in package `scala.quoted` as follows:
8888``` scala
8989 package scala .quoted
9090
91- sealed abstract class Expr [T ]
91+ sealed abstract class Expr [+ T ]
9292 sealed abstract class Type [T ]
9393```
9494Both ` Expr ` and ` Type ` are abstract and sealed, so all constructors for
You can’t perform that action at this time.
0 commit comments