-
Notifications
You must be signed in to change notification settings - Fork 403
Prefer immutable.Seq and Iterable #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a strange issue where def f[T](a: collection.mutable.ArrayBuffer[T]):collection.mutable.Seq[T] = {
if (a.isEmpty) collection.mutable.Seq.empty[T]
else a.to[collection.mutable.Seq]
}
f: [T](a: collection.mutable.ArrayBuffer[T])collection.mutable.Seq[T]Seemingly, this was because |
| import Prop.Arg | ||
|
|
||
| import scala.collection.immutable.Seq | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because Test.checkProperties return type is defined as Seq[(String,Result)].
13d9510 to
6a8015b
Compare
|
I didn't realize MiMa was disabled until #399 put it back. Turns out there are a lot of compatibility changes if |
Preparation for the new collections library. Cherry-picked from work on trying to: Add support for Scala 2.13-M4
Fix by removing parens.
The collections library doesn't do this automatically. Seemingly, this is because org.scalacheck.util.SerializableCanBuildFroms has implicits that interfere.
a8d9b13 to
88c291d
Compare
- method oneOf(Seq)Gen in object Gen's type is different in current version, where it is (immutable.Seq)Gen instead of (Seq)Gen - method sequence(Traversable,util.Buildable)Gen in object Gen's type is different in current version, where it is (Iterable,util.Buildable)Gen instead of (Traversable,util.Buildable)Gen - method properties()Seq in class Properties has a different result type in current version, where it is immutable.Seq rather than Seq - method checkProperties(Test#Parameters,Properties)Seq in object Test has a different result type in current version, where it is immutable.Seq rather than Seq - method canCreateNewSut(java.lang.Object,Traversable,Traversable)Boolean in interface commands.Commands's type is different in current version, where it is (java.lang.Object,Iterable,Iterable)Boolean instead of (java.lang.Object,Traversable,Traversable)Boolean - abstract method canCreateNewSut(java.lang.Object,Iterable,Iterable)Boolean in interface commands.Commands is present only in current version - method fromIterable(Traversable)java.lang.Object in interface util.Buildable's type is different in current version, where it is (Iterable)java.lang.Object instead of (Traversable)java.lang.Object
- method fromIterable(Traversable)java.lang.Object in trait util.Buildable does not have a correspondent in current version - method fromIterable(Iterable)java.lang.Object in trait util.Buildable is present only in current version
In preparation for the vaunted 2.13 collections library changes, I've cherry-picked a few of Julien Richard-Foy's changes in his 2.13.0-M4 porting work in #391. In the interest of better understanding the impending 2.13 release changes, it would be good to at least make piecewise progress.
Julien was looking at using the scala-collections-compat library and preserving the internal uses of
mutable.Seq. I investigated just switching to usingimmutable.Seqand making the switch fromTraversabletoIterable.These changes don't seem very onerous and they seem to work across multiple Scala versions and targets (including js and native).