Skip to content

Commit 87d0ddc

Browse files
committed
Add original tests
1 parent 9601642 commit 87d0ddc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/pos/i10900.scala

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
import scala.collection.IterableOps
22
def foo[CC[A] <: IterableOps[A, CC, CC[A]], A](collection: CC[A]) =
33
collection == collection
4+
5+
object Test1 {
6+
import scala.collection.IterableOps
7+
implicit class RichCollection[CC[A] <: IterableOps[A, CC, CC[A]], A](val collection: CC[A]) {
8+
def awm(update: CC[A] => CC[A]): CC[A] = {
9+
val newCollection = update(collection)
10+
if (newCollection == collection) collection else newCollection.awm(update)
11+
}
12+
}
13+
}
14+
15+
object Test2 {
16+
import scala.collection.IterableOps
17+
implicit class RichCollection[CC[A] <: IterableOps[A, CC, CC[A]], A](val collection: CC[A]) {
18+
def awm(update: CC[A] => CC[A]): CC[A] = update(collection) match {
19+
case `collection` => collection
20+
case updated => updated.awm(update)
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)