File tree Expand file tree Collapse file tree 1 file changed +22
-12
lines changed Expand file tree Collapse file tree 1 file changed +22
-12
lines changed Original file line number Diff line number Diff line change 1
1
trait Expr [T ]
2
2
trait Liftable [T ]
3
3
4
- /* given autoToExpr[T] as Conversion[T, Expr[T]] given Liftable[T] {
5
- def apply(x: T): Expr[T] = ???
6
- }
7
- */
8
- class ToExpr [T ] given Liftable [T ] extends Conversion [T , Expr [T ]] {
9
- def apply (x : T ): Expr [T ] = ???
4
+ object test1 {
5
+ class ToExpr [T ] given Liftable [T ] extends Conversion [T , Expr [T ]] {
6
+ def apply (x : T ): Expr [T ] = ???
7
+ }
8
+ given toExpr [T ] as ToExpr [T ] given Liftable [T ]
9
+
10
+ given as Liftable [Int ] = ???
11
+ given as Liftable [String ] = ???
12
+
13
+ def x = the[ToExpr [String ]]
14
+ def y = the[Conversion [String , Expr [String ]]]
15
+
16
+ def a : Expr [String ] = " abc"
10
17
}
11
- given toExpr [T ] as ToExpr [T ] given Liftable [T ]
12
18
13
- given as Liftable [Int ] = ???
14
- given as Liftable [String ] = ???
19
+ object test2 {
20
+
21
+ given autoToExpr [T ] as Conversion [T , Expr [T ]] given Liftable [T ] {
22
+ def apply (x : T ): Expr [T ] = ???
23
+ }
15
24
16
- def x = the[ ToExpr [ String ]]
17
- def y = the[ Conversion [ String , Expr [String ]]]
25
+ given as Liftable [ Int ] = ???
26
+ given as Liftable [String ] = ???
18
27
19
- def a : Expr [String ] = " abc"
28
+ def a : Expr [String ] = " abc"
29
+ }
You can’t perform that action at this time.
0 commit comments