diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-03-27 13:23:49 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-03-27 16:16:11 +0100 |
commit | a0c3bbdb3a4b1055834f3ff5f729dc3af1867696 (patch) | |
tree | 1f05aeae0ae50adcbe6fa5c48287015edc573c21 /test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala | |
parent | c765537cb3532a7b88f1b68331840953f3e9d048 (diff) | |
download | scala-a0c3bbdb3a4b1055834f3ff5f729dc3af1867696.tar.gz scala-a0c3bbdb3a4b1055834f3ff5f729dc3af1867696.tar.bz2 scala-a0c3bbdb3a4b1055834f3ff5f729dc3af1867696.zip |
SI-8451 quasiquotes now handle quirks of secondary constructors
Apparently even though the rhs of a secondary constructor looks like an expr,
it always gets wrapped in a block by the parser. This works just fine with
the typer, but crashes in uncurry. This commit brings quasiquotes in line with the parser.
Diffstat (limited to 'test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala')
-rw-r--r-- | test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala b/test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala index 69aef12668..fd810674f5 100644 --- a/test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/DefinitionConstructionProps.scala @@ -90,6 +90,15 @@ trait ClassConstruction { self: QuasiquoteProperties => val args = q"val a: Int; val b: Int" assertEqAst(q"class C(implicit ..$args)", "class C(implicit val a: Int, val b: Int)") } + + property("SI-8451: inline secondary constructors") = test { + assertEqAst(q"class C(x: Int) { def this() = this(0) }", "class C(x: Int) { def this() = this(0) }") + } + + property("SI-8451: unquoted secondary constructors") = test { + val secondaryCtor = q"def this() = this(0)" + assertEqAst(q"class C(x: Int) { $secondaryCtor }", "class C(x: Int) { def this() = this(0) }") + } } trait TraitConstruction { self: QuasiquoteProperties => |