Skip to content

Commit 2a72ffb

Browse files
authored
Merge pull request #3148 from dotty-staging/fix-2239
Add test case for #2239
2 parents 4243345 + 1247b6f commit 2a72ffb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/pos/i2239.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
trait Rule[-In, +A] extends (In => A) {
2+
def flatMap[In2 <: In, B](fa2ruleb: A => Rule[In2, Seq[B]]): Rule[In, Seq[B]] = ???
3+
def map[B](fa2b: A => B): Rule[In, B] = ???
4+
5+
def ~++[In2, B >: A](next: => Rule[In2, Seq[B]]) = for (a <- this; b <- next) yield a :: b.toList
6+
// def ~++[In2, B >: A](next: => Rule[In2, Seq[B]]): Rule[In, Seq[B]] = for (a <- this; b <- next) yield a :: b.toList
7+
}
8+
9+
class SeqRule {
10+
type S
11+
type A
12+
def * : Rule[S, List[A]] = ???
13+
def +(rule: Rule[S, A]) : Rule[S, Seq[A]] = rule ~++ *
14+
}

0 commit comments

Comments
 (0)