Skip to content

Commit 4cb4f4c

Browse files
committed
Add test
1 parent c69985c commit 4cb4f4c

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

tests/pos/i6914.scala

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
trait Expr[T]
22
trait Liftable[T]
33

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"
1017
}
11-
given toExpr[T] as ToExpr[T] given Liftable[T]
1218

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+
}
1524

16-
def x = the[ToExpr[String]]
17-
def y = the[Conversion[String, Expr[String]]]
25+
given as Liftable[Int] = ???
26+
given as Liftable[String] = ???
1827

19-
def a: Expr[String] = "abc"
28+
def a: Expr[String] = "abc"
29+
}

0 commit comments

Comments
 (0)