File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ class Expr[T] extends Quoted {
66}
77
88object Expr {
9- implicit def toExpr [T ](x : T )(implicit ev : Quotable [T ]): Expr [T ] =
9+ implicit def toExpr [T ](x : T )(implicit ev : Liftable [T ]): Expr [T ] =
1010 ev.toExpr(x)
1111}
Original file line number Diff line number Diff line change 11package scala .quoted
2- import scala .math
32
43/** A typeclass for types that can be turned to `quoted.Expr[T]`
54 * without going through an explicit `'(...)` operation.
65 */
7- abstract class Quotable [T ] {
6+ abstract class Liftable [T ] {
87 implicit def toExpr (x : T ): Expr [T ]
98}
109
11- /** Some base quotable types. To be completed with at least all types
10+ /** Some liftable base types. To be completed with at least all types
1211 * that are valid Scala literals. The actual implementation of these
1312 * typed could be in terms of `ast.tpd.Literal`; the test `quotable.scala`
1413 * gives an alternative implementation using just the basic staging system.
1514 */
16- object Quotable {
17-
18- implicit def IntIsQuotable : Quotable [Int ] = ???
19- implicit def BooleanIsQuotable : Quotable [Boolean ] = ???
15+ object Liftable {
16+ implicit def IntIsLiftable : Liftable [Int ] = ???
17+ implicit def BooleanIsLiftable : Liftable [Boolean ] = ???
2018}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ object Test {
1717 if (b) '(true) else ' (false )
1818 }
1919
20- implicit def ListIsQuotable [T : Type : Quotable ]: Quotable [List [T ]] = new {
20+ implicit def ListIsQuotable [T : Quotable ]: Quotable [List [T ]] = new {
2121 def toExpr (xs : List [T ]): Expr [List [T ]] = xs match {
2222 case x :: xs1 => ' { ~ implicitly[Quotable [T ]].toExpr(x) :: ~ toExpr(xs1) }
2323 case Nil => '(Nil: List[T])
You can’t perform that action at this time.
0 commit comments