Skip to content

Commit 7458842

Browse files
committed
Add toExpr where needed
1 parent 6cd8e2b commit 7458842

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/run-with-compiler/i3847-b.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.reflect.ClassTag
44

55
object Arrays {
66
implicit def ArrayIsLiftable[T: Liftable](implicit t: Type[T]): Liftable[Array[List[T]]] = (arr: Array[List[T]]) => '{
7-
new Array[List[~t]](~(arr.length: Expr[Int]))
7+
new Array[List[~t]](~arr.length.toExpr)
88
// TODO add elements
99
}
1010
}
@@ -13,7 +13,7 @@ object Test {
1313
def main(args: Array[String]): Unit = {
1414
import Arrays._
1515
implicit val ct: Expr[ClassTag[Int]] = '(ClassTag.Int)
16-
val arr: Expr[Array[List[Int]]] = Array[List[Int]](List(1, 2, 3))
16+
val arr: Expr[Array[List[Int]]] = Array[List[Int]](List(1, 2, 3)).toExpr
1717
println(arr.show)
1818
}
1919
}

tests/run-with-compiler/i3847.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.reflect.ClassTag
44

55
object Arrays {
66
implicit def ArrayIsLiftable[T: Liftable](implicit t: Type[T], ct: Expr[ClassTag[T]]): Liftable[Array[T]] = (arr: Array[T]) => '{
7-
new Array[~t](~(arr.length: Expr[Int]))(~ct)
7+
new Array[~t](~arr.length.toExpr)(~ct)
88
// TODO add elements
99
}
1010
}
@@ -13,7 +13,7 @@ object Test {
1313
def main(args: Array[String]): Unit = {
1414
import Arrays._
1515
implicit val ct: Expr[ClassTag[Int]] = '(ClassTag.Int)
16-
val arr: Expr[Array[Int]] = Array[Int](1, 2, 3)
16+
val arr: Expr[Array[Int]] = Array[Int](1, 2, 3).toExpr
1717
println(arr.show)
1818
}
1919
}

0 commit comments

Comments
 (0)