diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-12-02 18:50:40 +0100 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-12-10 14:09:27 +0100 |
commit | 8bde124040f3e053d6312702f2cd722ac92fc132 (patch) | |
tree | 7a885b01a74b959ceb3b53272b37034591d9ad3a /test/files/scalacheck | |
parent | b345b42cac64aa97e3bbcc6f14ef8f08214ab56f (diff) | |
download | scala-8bde124040f3e053d6312702f2cd722ac92fc132.tar.gz scala-8bde124040f3e053d6312702f2cd722ac92fc132.tar.bz2 scala-8bde124040f3e053d6312702f2cd722ac92fc132.zip |
SI-8008 Make q”f(..$xs)” only match trees with Apply node
Previously it also matched other nodes but returned Nil as value of xs.
This behavior was added for sake of consistentcy with q”f[..$ts]”. On
the other hand q”f[..$Nil]” == q”f” but q”f(..$Nil)” == q”f()” not q”f”.
Due to this deconstruction/construction symmetry was broken.
On the other hand applications also have q"f(...$xss)" option which is
infact similar to q"f[..$ts]". Splicing Nil into it also results in q"f".
Diffstat (limited to 'test/files/scalacheck')
-rw-r--r-- | test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala index bd81afa125..8d1ada342a 100644 --- a/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala @@ -3,8 +3,10 @@ import scala.reflect.runtime.universe._, Flag._ object TermDeconstructionProps extends QuasiquoteProperties("term deconstruction") { property("f(..x) = f") = test { - val q"f(..$args)" = q"f" - assert(args ≈ Nil) + // see SI-8008 + assertThrows[MatchError] { + val q"f(..$args)" = q"f" + } } property("f(x)") = forAll { (x: Tree) => |