File tree 3 files changed +7
-9
lines changed
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 {
6
6
}
7
7
8
8
object 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 ] =
10
10
ev.toExpr(x)
11
11
}
Original file line number Diff line number Diff line change 1
1
package scala .quoted
2
- import scala .math
3
2
4
3
/** A typeclass for types that can be turned to `quoted.Expr[T]`
5
4
* without going through an explicit `'(...)` operation.
6
5
*/
7
- abstract class Quotable [T ] {
6
+ abstract class Liftable [T ] {
8
7
implicit def toExpr (x : T ): Expr [T ]
9
8
}
10
9
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
12
11
* that are valid Scala literals. The actual implementation of these
13
12
* typed could be in terms of `ast.tpd.Literal`; the test `quotable.scala`
14
13
* gives an alternative implementation using just the basic staging system.
15
14
*/
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 ] = ???
20
18
}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ object Test {
17
17
if (b) '(true) else ' (false )
18
18
}
19
19
20
- implicit def ListIsQuotable [T : Type : Quotable ]: Quotable [List [T ]] = new {
20
+ implicit def ListIsQuotable [T : Quotable ]: Quotable [List [T ]] = new {
21
21
def toExpr (xs : List [T ]): Expr [List [T ]] = xs match {
22
22
case x :: xs1 => ' { ~ implicitly[Quotable [T ]].toExpr(x) :: ~ toExpr(xs1) }
23
23
case Nil => '(Nil: List[T])
You can’t perform that action at this time.
0 commit comments