diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-09-05 13:35:42 +0200 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-09-05 20:42:10 +0200 |
commit | a455858fc19e47dca10f446df0f61297d0d60276 (patch) | |
tree | 002b867b22f973757c76ca70b506451987f6cf73 /test/files/scalacheck/quasiquotes | |
parent | 546e94099d667c6395582fcba321ef95578121a5 (diff) | |
download | scala-a455858fc19e47dca10f446df0f61297d0d60276.tar.gz scala-a455858fc19e47dca10f446df0f61297d0d60276.tar.bz2 scala-a455858fc19e47dca10f446df0f61297d0d60276.zip |
SI-7723 better support for deconstruction of new expressions
Diffstat (limited to 'test/files/scalacheck/quasiquotes')
-rw-r--r-- | test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala index 762625a46a..45c7ee4bb7 100644 --- a/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala @@ -74,4 +74,21 @@ object TermDeconstructionProps extends QuasiquoteProperties("term deconstruction matches("(y: Y) => y oh y") matches("(x: X, y: Y) => x and y") } + + property("exhaustive new pattern") = test { + def matches(line: String) { + val q"new { ..$early } with $name[..$targs](...$vargss) with ..$mixin { $self => ..$body }" = parse(line) + } + matches("new foo") + matches("new foo { body }") + matches("new foo[t]") + matches("new foo(x)") + matches("new foo[t](x)") + matches("new foo[t](x) { body }") + matches("new foo with bar") + matches("new foo with bar { body }") + matches("new { anonymous }") + matches("new { val early = 1} with Parent[Int] { body }") + matches("new Foo { selfie => }") + } } |