diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-11-19 09:38:28 -0800 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-11-19 09:38:28 -0800 |
commit | 888d0b4868a62c8d8288a4a8b639d282355ac33f (patch) | |
tree | d937a0d4f4d5e7c28580dc393ca7e7047ad632e1 /test/files | |
parent | c81ef00dece5582f5f53b9b4320f7b755cc6bdae (diff) | |
parent | 32c57329a6cb7ff1fa479a1fce884b8166f3fc50 (diff) | |
download | scala-888d0b4868a62c8d8288a4a8b639d282355ac33f.tar.gz scala-888d0b4868a62c8d8288a4a8b639d282355ac33f.tar.bz2 scala-888d0b4868a62c8d8288a4a8b639d282355ac33f.zip |
Merge pull request #1638 from adriaanm/ticket-6624
SI-6624 better lookup of case field accessors for case class pattern with complicated type
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t6624.scala | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/files/pos/t6624.scala b/test/files/pos/t6624.scala new file mode 100644 index 0000000000..1a92b92d53 --- /dev/null +++ b/test/files/pos/t6624.scala @@ -0,0 +1,28 @@ +sealed trait KList[+M[_]] + +case class KCons[M[_], +T <: KList[M]]( + tail: T +) extends KList[M] + +case class KNil[M[_]]() extends KList[M] + +object Test { + val klist: KCons[Option, KCons[Option, KCons[Option, KNil[Nothing]]]] = ??? + + // crashes with + // "Exception in thread "main" scala.reflect.internal.Types$TypeError: value _1 is not a member + // of KCons[Option,KCons[Option,KNil[Nothing]]]" + klist match { + case KCons(KCons(KCons(_))) => + } + + // fails with a similar message as an error, rather than a crash. + klist match { + case KCons(KCons(_)) => + } + + // succeeds + klist match { + case KCons(_) => + } +}
\ No newline at end of file |