diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-12-02 15:30:22 +0100 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-12-10 16:02:44 +0100 |
commit | 26a33482718dc165ed5f9c4703205c94b9d0c058 (patch) | |
tree | 307f784b261ff32d1aff44d6a26796aa163e9599 /test/files/scalacheck | |
parent | 0ccd4bcac64efe72d9758fbfb6a6dbce44cf308e (diff) | |
download | scala-26a33482718dc165ed5f9c4703205c94b9d0c058.tar.gz scala-26a33482718dc165ed5f9c4703205c94b9d0c058.tar.bz2 scala-26a33482718dc165ed5f9c4703205c94b9d0c058.zip |
SI-7979 Fix quasiquotes crash on mismatch between fields and constructor
Diffstat (limited to 'test/files/scalacheck')
-rw-r--r-- | test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala index dbd26bf72a..94465930ed 100644 --- a/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/DefinitionDeconstructionProps.scala @@ -88,6 +88,22 @@ trait ClassDeconstruction { self: QuasiquoteProperties => matches("class Foo { self => bar(self) }") matches("case class Foo(x: Int)") } + + property("SI-7979") = test { + val PARAMACCESSOR = (1 << 29).toLong.asInstanceOf[FlagSet] + assertThrows[MatchError] { + val build.SyntacticClassDef(_, _, _, _, _, _, _, _, _) = + ClassDef( + Modifiers(), TypeName("Foo"), List(), + Template( + List(Select(Ident(TermName("scala")), TypeName("AnyRef"))), + noSelfType, + List( + //ValDef(Modifiers(PRIVATE | LOCAL | PARAMACCESSOR), TermName("x"), Ident(TypeName("Int")), EmptyTree), + DefDef(Modifiers(), nme.CONSTRUCTOR, List(), List(List(ValDef(Modifiers(PARAM | PARAMACCESSOR), TermName("x"), + Ident(TypeName("Int")), EmptyTree))), TypeTree(), Block(List(pendingSuperCall), Literal(Constant(()))))))) + } + } } trait ModsDeconstruction { self: QuasiquoteProperties => |