Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit aceb216

Browse files
committed
Add a test for -Zirrefutable-generator-patterns
1 parent 062e56c commit aceb216

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Zirrefutable-generator-patterns
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
case class Foo[A](a: A) {
2+
def map[B](f: A => B): Foo[B] = Foo(f(a))
3+
def flatMap[B](f: A => Foo[B]): Foo[B] = Foo(f(a).a)
4+
}
5+
6+
object Test {
7+
for {
8+
(a, b) <- Foo((1, 'd'))
9+
(c, d, e) <- Foo((1, true, "three"))
10+
} yield (a + c, e :+ b, !d)
11+
}

0 commit comments

Comments
 (0)