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/ErrorProps.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/ErrorProps.scala')
-rw-r--r-- | test/files/scalacheck/quasiquotes/ErrorProps.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/scalacheck/quasiquotes/ErrorProps.scala b/test/files/scalacheck/quasiquotes/ErrorProps.scala index 9137fe17d8..2cba07abf2 100644 --- a/test/files/scalacheck/quasiquotes/ErrorProps.scala +++ b/test/files/scalacheck/quasiquotes/ErrorProps.scala @@ -195,6 +195,19 @@ object ErrorProps extends QuasiquoteProperties("errors") { q"f(..$l)" """) + property("SI-8451 construction: disallow everything except for constructor calls in secondary constructor bodies") = fails( + "'this' expected but unquotee found", + """ + val rhs1 = q"this(0)" + val ctor1 = q"def this(x: Int) = $rhs1" + """) + + property("SI-8451 deconstruction: disallow everything except for constructor calls in secondary constructor bodies") = fails( + "'this' expected but unquotee found", + """ + val q"def this(..$params) = $rhs2" = q"def this(x: Int) = this(0)" + """) + // // Make sure a nice error is reported in this case // { import Flag._; val mods = NoMods; q"lazy $mods val x: Int" } } |