From 6c0184b157dd218d4b6f854e7142efdf074e596c Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 27 Apr 2016 13:58:29 +0200 Subject: Test case --- tests/pos/i1235.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/pos/i1235.scala diff --git a/tests/pos/i1235.scala b/tests/pos/i1235.scala new file mode 100644 index 000000000..1fbb82ac1 --- /dev/null +++ b/tests/pos/i1235.scala @@ -0,0 +1,16 @@ +case class LazyList[T](headThunk: () => T, tailThunk: () => LazyList[T]){ + lazy val head = headThunk() + lazy val tail = tailThunk() +} + +object ~: { + def unapply[T](x: LazyList[T]) = Some((x.head, x.tail)) +} + +object MinimizedMatchFail { + val ll = LazyList(() => 1, () => LazyList(() => 2, () => ???)) + + ll match { + case lb ~: rest => println("success") + } +} -- cgit v1.2.3