diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-09-02 15:51:56 +0200 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-09-05 14:39:12 +0200 |
commit | 901cdc1855e8e80957b18add4991736b9f458d77 (patch) | |
tree | b6ac94c657f262d3a4e398e36b07d042ba4fbfa1 /test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala | |
parent | f9d5e3d4e8cca61ee75072ab13c2935061a1850e (diff) | |
download | scala-901cdc1855e8e80957b18add4991736b9f458d77.tar.gz scala-901cdc1855e8e80957b18add4991736b9f458d77.tar.bz2 scala-901cdc1855e8e80957b18add4991736b9f458d77.zip |
refine block and applied/typeapplied splicing/matching semantics
1. blocks now match single term-level expressions to account for
automatic block elimination. E.g.
val q"{ ..$stats }" = q"foo"
will match into stats = List(q"foo"). This is useful to uniformly
deal with blocks on term level.
2. blocks in quasiquotes collapse into single expressions
3. Applied and TypeApplied now have constructors too which helps
to unify matching and extraction in quasiquote reifier
4. TypeApplied now matches AppliedTypeTree too
5. Add Syntactic prefix to Applied and TypeApplied
Diffstat (limited to 'test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala')
-rw-r--r-- | test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala b/test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala index 5d657b931b..dc3fc60f8c 100644 --- a/test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala @@ -118,7 +118,7 @@ trait TypeDefConstruction { self: QuasiquoteProperties => property("splice into applied type tree") = forAll { (T1: TypeName, T2: TypeName, args: List[Tree]) => q"type $T1 = $T2[..$args]" ≈ TypeDef(Modifiers(), T1, List(), - AppliedTypeTree(Ident(T2), args)) + if(args.nonEmpty) AppliedTypeTree(Ident(T2), args) else Ident(T2)) } } |