squid icon indicating copy to clipboard operation
squid copied to clipboard

Vararg unquote with non-identifier fails to compile

Open LPTK opened this issue 8 years ago • 0 comments

See the example:

code"Seq(1,2,3)" match {
  case code"Seq[Int]($xs*)" =>
    val xs2 = c"0" +: xs
    code"Seq[Int](${xs2}*)" // works fine
    // a current limitation/bug prevents the following syntax:
    // code"Seq[Int](${c"0" +: xs}*)"
    //   Embedding Error: Quoted expression does not type check: type mismatch;
    //     found: Any; required: Seq[Embedding.IR[Int,?]])
}

LPTK avatar Sep 28 '17 22:09 LPTK