Skip to content

Conversation

julienrf
Copy link

@julienrf julienrf commented Mar 29, 2018

In the process of making the new collections as compatible as possible with the old collections, I’ve migrated this project to find out where the incompatibilities are.

Most of the changes shown in the diff have been automatically applied by a scalafix rewrite rule. In some cases I had to take decisions or just rewrite things differently. I’m using the scala-collection-compat library to make 2.13’s API available on 2.12 and prior Scala versions. I use two specific source directories, for 2.13 on one side, and for 2.12 and prior Scala versions on the other side, to implement a custom collection (ArrayListBuilder).

The changes automatically handled by the rewrite rule are the following:

  • replace Traversable with Iterable,
  • add parens to calls to iterator() and newBuilder(),
  • replace Stream#append with Stream#lazyAppendAll.

The areas that are not handled by the rewrite rule are the following:

  • CanBuildFrom usage (here, replaced with Factory),
  • scala.Seq usage (here, I chose the conservative approach that consists in using scala.collection.Seq, which is the same on 2.12 and 2.13, instead of scala.Seq, which expands to immutable.Seq on 2.13),
  • implementation of a type provided by the collection API (here, ArrayListBuilder).

@julienrf julienrf force-pushed the collection-strawman branch from 563ebaf to b3e8a37 Compare March 29, 2018 09:48
@julienrf
Copy link
Author

We can currently only jvm/test on 2.12 and 2.13, Scala.js and native aren’t supported yet.

@julienrf
Copy link
Author

julienrf commented Apr 3, 2018

@rickynils It would be useful for us to have a scalacheck release compatible with Scala 2.13.0-M4-pre-20d3c21. Would it be possible for you to publish such a release?

@lrytz
Copy link
Contributor

lrytz commented May 15, 2018

New WIP PR at #411

@rickynils
Copy link
Contributor

Superseded by #411

@rickynils rickynils closed this Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants