Skip to content

Commit

Permalink
Add IterableOnce operations to IterableOnceOps
Browse files Browse the repository at this point in the history
Fixes scala/bug#11675

This change is backward compatible, because nothing is removed.
It should also be forward compatible, because `IterableOnceOps[A]` had
`IterableOnce[A]` as a self-type on 2.13.0, meaning that code relying on the
newly introduced methods also worked on 2.13.0 because any `IterableOnceOps[A]`
instance was also effectively an `IterableOnce[A]`.
  • Loading branch information
julienrf committed Aug 19, 2019
1 parent f23f96c commit 3fe7949
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Expand Up @@ -93,8 +93,8 @@ val mimaFilterSettings = Seq(
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.typeTag"),
ProblemFilters.exclude[MissingClassProblem]("scala.reflect.runtime.JavaMirrors$JavaMirror$typeTagCache$"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.api.TypeTags.TypeTagImpl"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.api.Universe.TypeTagImpl"),
),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.api.Universe.TypeTagImpl")
)
)

// Save MiMa logs
Expand Down
3 changes: 2 additions & 1 deletion src/library/scala/collection/IterableOnce.scala
Expand Up @@ -296,7 +296,8 @@ object IterableOnce {
* @define coll collection
*
*/
trait IterableOnceOps[+A, +CC[_], +C] extends Any { this: IterableOnce[A] =>
trait IterableOnceOps[+A, +CC[_], +C] extends Any with IterableOnce[A] {

/////////////////////////////////////////////////////////////// Abstract methods that must be implemented

/** Produces a $coll containing cumulative results of applying the
Expand Down
2 changes: 1 addition & 1 deletion test/files/neg/abstract-report.check
@@ -1,6 +1,6 @@
abstract-report.scala:1: error: class Unimplemented needs to be abstract.
Missing implementations for 6 members. Stub implementations follow:
// Members declared in scala.collection.IterableOnce
// Members declared in scala.collection.IterableOnceOps
def iterator: Iterator[String] = ???

// Members declared in scala.collection.IterableOps
Expand Down
2 changes: 1 addition & 1 deletion test/files/neg/abstract-report2.check
Expand Up @@ -54,7 +54,7 @@ class Baz[T] extends Collection[T]
^
abstract-report2.scala:15: error: class Dingus needs to be abstract.
Missing implementations for 7 members. Stub implementations follow:
// Members declared in scala.collection.IterableOnce
// Members declared in scala.collection.IterableOnceOps
def iterator: Iterator[(Set[Int], String)] = ???

// Members declared in scala.collection.IterableOps
Expand Down

0 comments on commit 3fe7949

Please sign in to comment.