File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
run-macros/quote-matcher-symantics-3 Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,15 @@ object Macros {
8
8
inline def assert (expr : => Boolean ): Unit =
9
9
$ { assertImpl(' expr ) }
10
10
11
- def assertImpl (expr : Expr [Boolean ])(given QuoateContext ) =
11
+ def assertImpl (expr : Expr [Boolean ])(given QuoteContext ) =
12
12
' { if ! ($expr) then throw new AssertionError (s " failed assertion: ${$ {showExpr(expr)}}" ) }
13
13
14
14
15
- def showExpr [T ](expr : Expr [T ])(given QuoateContext ): Expr [String ] = expr.toString
15
+ def showExpr [T ](expr : Expr [T ])(given QuoteContext ): Expr [String ] = expr.toString
16
16
17
17
inline def power (inline n : Int , x : Double ) = $ { powerCode(n, ' x ) }
18
18
19
- def powerCode (n : Int , x : Expr [Double ])(given QuoateContext ): Expr [Double ] =
19
+ def powerCode (n : Int , x : Expr [Double ])(given QuoteContext ): Expr [Double ] =
20
20
if (n == 0 ) ' {1.0 }
21
21
else if (n == 1 ) x
22
22
else if (n % 2 == 0 ) ' { { val y = $x * $x; $ { powerCode(n / 2 , ' y ) } } }
@@ -25,7 +25,7 @@ object Macros {
25
25
26
26
class Test {
27
27
28
- given as Toolbox = Toolbox .make(getClass.getClassLoader)
28
+ given Toolbox = Toolbox .make(getClass.getClassLoader)
29
29
30
30
run {
31
31
val program = ' {
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ object Macros {
17
17
env.updated(id, ref)
18
18
19
19
object FromEnv {
20
- def unapply [T ](id : Bind [T ])(given Env : Option [Expr [R [T ]]]) =
20
+ def unapply [T ](id : Bind [T ])(given Env ) : Option [Expr [R [T ]]] =
21
21
summon[Env ].get(id).asInstanceOf [Option [Expr [R [T ]]]] // We can only add binds that have the same type as the refs
22
22
}
23
23
Original file line number Diff line number Diff line change 1
- ((qctx: scala.quoted.QuoteContext) => '{3}( given (qctx) ))
1
+ ((qctx: scala.quoted.QuoteContext) => '{3} given (qctx))
You can’t perform that action at this time.
0 commit comments