File tree Expand file tree Collapse file tree 6 files changed +7
-9
lines changed Expand file tree Collapse file tree 6 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ object Liftable {
2020 def toExpr (implicit liftable : Liftable [T ]): Expr [T ] = liftable.toExpr(x)
2121 }
2222
23- implicit def UnitIsLiftable : Liftable [Unit ] = (x : Unit ) => new ValueExpr (x)
2423 implicit def BooleanIsLiftable : Liftable [Boolean ] = (x : Boolean ) => new ValueExpr (x)
2524 implicit def ByteLiftable : Liftable [Byte ] = (x : Byte ) => new ValueExpr (x)
2625 implicit def CharIsLiftable : Liftable [Char ] = (x : Char ) => new ValueExpr (x)
Original file line number Diff line number Diff line change 11import scala .quoted ._
22object Macro {
33 inline def ff : Unit = ~ impl(' [Int ])
4- def impl (t : Type [Int ]): Expr [Unit ] = ()
5- }
4+ def impl (t : Type [Int ]): Expr [Unit ] = ' ()
5+ }
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ object Test {
3333 (1.0f : Expr [Float ])
3434 (1.0 : Expr [Double ])
3535 (" abc" : Expr [String ])
36- ((): Expr [Unit ])
3736
3837 val xs : Expr [List [Int ]] = 1 :: 2 :: 3 :: Nil
3938}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import dotty.tools.dotc.quoted.Toolbox._
22import scala .quoted ._
33object Test {
44 def main (args : Array [String ]): Unit = {
5- val u : Expr [Unit ] = ()
5+ val u : Expr [Unit ] = ' ()
66 println(u.show)
77 println(u.run)
88 }
Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ object Test {
1212 if (n == 0 ) x
1313 else a(n - 1 , ' { println(~ n.toExpr); ~ x })
1414
15- println(a(5 , ()).show)
15+ println(a(5 , ' ()).show)
1616
1717
1818 def b (n : Int , x : Expr [Unit ]): Expr [Unit ] =
1919 if (n == 0 ) x
2020 else b(n - 1 , ' { ~ x; println(~ n.toExpr) })
2121
22- println(b(5 , ()).show)
22+ println(b(5 , ' ()).show)
2323 }
2424
2525}
Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ object Test {
1111 if (n == 0 ) x
1212 else a(n - 1 , ' { println(~ n.toExpr); ~ x })
1313
14- println(a(5 , ()).show)
14+ println(a(5 , ' ()).show)
1515
1616
1717 def b (n : Int , x : Expr [Unit ]): Expr [Unit ] =
1818 if (n == 0 ) x
1919 else b(n - 1 , ' { ~ x; println(~ n.toExpr) })
2020
21- println(b(5 , ()).show)
21+ println(b(5 , ' ()).show)
2222 }
2323
2424}
You can’t perform that action at this time.
0 commit comments