-
```scala
scala> val q"trait X { ..$stats }" = q"trait X { def x: Int }"
scala.MatchError: abstract trait X extends scala.AnyRef {
def x: Int
} (of class scala.reflect.internal.Trees$ClassDef)
…
-
```scala
import scala.reflect.macros.whitebox._
import scala.language.experimental.macros
object Macros {
def impl(c: Context)(x: c.Tree) = {
import c.universe._
val q"{ class $name(.…
-
It would be nice to have [lifting](http://docs.scala-lang.org/overviews/quasiquotes/lifting) and [unlifting](http://docs.scala-lang.org/overviews/quasiquotes/unlifting) support.
```scala
inline def …
-
Quasiquotes fail to parse following pattern:
```scala
:34: error: ';' expected but 'val' found.
val q"class C { $mods val x = $expr }" = q"class C { val x = 1 }"
…
-
From the `match` documentation I could swear I could match prefab structs. But...
```racket
> (match #s(pos 1 2)
[#s(pos x ...) (values ...)])
. match: syntax error in pattern in: #s(pos x ...…
-
Firstly we can only undo tree transformations not the potential side-effects induced by macro implementations during the expansion.
Secondly (and more importantly from the practical point of view),…
-
Let's say we want to create a bunch of definitions of vals v1...vN with values equal to N:
```scala
(1 to N).map { i =>
val name = TermName(s"v$i")
q"val $name = $i"
}
```
What I would like …
-
It would be really nice if quasiquotes let you customize positions of trees like:
```scala
val pos: Position = ...
q"@$pos def bar"
q"(1 + 2): @$pos"
```
Similar syntax can be used for extraction…
-
```scala
scala> val q"..$_; $_($_: ${tpe: Type})" =
| typecheck(q"""
| def id(i: Int) = i
| val a = 42
| id(a)
| """)
tpe: reflect.runtime.universe.Type…
-
Such macro will compile, but fails to expand.
```scala
def aggregate[T: c.WeakTypeTag, S: c.WeakTypeTag](c: Context)(z: c.Expr[S])(combop: c.Expr[(S, S) => S])(seqop: c.Expr[(S, T) => S]): c.Expr[S]…