From cd07f9f9656ea1bdc6c27ef2be9192d52cd987a5 Mon Sep 17 00:00:00 2001 From: Den Shabalin Date: Thu, 5 Sep 2013 13:40:38 +0200 Subject: better support for ValDefs, VarDefs and DefDefs --- .../scalacheck/quasiquotes/DefinitionDeconstructionProps.scala | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/files') diff --git a/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala index d6b60c4351..fdfbfe871c 100644 --- a/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala @@ -134,5 +134,14 @@ trait ValVarDeconstruction { self: QuasiquoteProperties => matches("val x: Int = 1") matches("lazy val x: Int = 1") matches("implicit val x = 1") + assertThrows[MatchError] { matches("var x = 1") } + } + + property("exhaustive var matcher") = test { + def matches(line: String) { val q"$mods var $name: $tpt = $rhs" = parse(line) } + matches("var x: Int") + matches("var x: Int = 1") + matches("var x = 1") + assertThrows[MatchError] { matches("val x = 1") } } } \ No newline at end of file -- cgit v1.2.3