Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/run/quote-force.check
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo Location(List(a, b, c, d, e, f))
18 changes: 18 additions & 0 deletions tests/run/quote-force/quoted_1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import scala.quoted._

case class Location(owners: List[String])

object Location {

implicit inline def location: Location = ~impl

def impl: Expr[Location] = {
val list = List("a", "b", "c", "d", "e", "f")
'(new Location(~list.toExpr))
}

private implicit def ListIsLiftable[T : Liftable : Type]: Liftable[List[T]] = {
case x :: xs => '{ ~x.toExpr :: ~xs.toExpr }
case Nil => '{ List.empty[T] }
}
}
12 changes: 12 additions & 0 deletions tests/run/quote-force/quoted_2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Location._

object Test {
val loc1 = location
def main(args: Array[String]): Unit = {
foo(loc1)
}

def foo(implicit location: Location): Unit = {
println("foo " + location)
}
}