From 1247b6f785d22fd66242df649ef92c5d35cbcbf3 Mon Sep 17 00:00:00 2001 From: liu fengyun Date: Mon, 11 Sep 2017 17:59:08 +0200 Subject: [PATCH] add test case for #2239 --- tests/pos/i2239.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/pos/i2239.scala diff --git a/tests/pos/i2239.scala b/tests/pos/i2239.scala new file mode 100644 index 000000000000..4eb64d8b3508 --- /dev/null +++ b/tests/pos/i2239.scala @@ -0,0 +1,14 @@ +trait Rule[-In, +A] extends (In => A) { + def flatMap[In2 <: In, B](fa2ruleb: A => Rule[In2, Seq[B]]): Rule[In, Seq[B]] = ??? + def map[B](fa2b: A => B): Rule[In, B] = ??? + + def ~++[In2, B >: A](next: => Rule[In2, Seq[B]]) = for (a <- this; b <- next) yield a :: b.toList + // def ~++[In2, B >: A](next: => Rule[In2, Seq[B]]): Rule[In, Seq[B]] = for (a <- this; b <- next) yield a :: b.toList +} + +class SeqRule { + type S + type A + def * : Rule[S, List[A]] = ??? + def +(rule: Rule[S, A]) : Rule[S, Seq[A]] = rule ~++ * +}