-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #566 from rjolly/main
- Loading branch information
Showing
7 changed files
with
782 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,12 @@ All future versions will remain backwards binary compatible with 2.0.0. (The 1.0 | |
|
||
## How it works | ||
|
||
The 2.13 and 3.0 versions consist only of an empty `scala.collection.compat` package object, so `import scala.collection.compat._` won't cause an error in cross-compiled code. | ||
|
||
The 2.11 and 2.12 versions have the needed compatibility code in this package. | ||
|
||
### Changed methods | ||
|
||
The 2.13 collections redesign did not break source compatibility for most ordinary code, but there are some exceptions. | ||
|
||
For example, the `to` method is used with a type parameter in 2.12: | ||
|
@@ -37,15 +43,25 @@ import scala.collection.compat._ | |
xs.to(List) | ||
``` | ||
|
||
The 2.13 and 3.0 versions consist only of an empty `scala.collection.compat` package object, so `import scala.collection.compat._` won't cause an error in cross-compiled code. | ||
|
||
The 2.11 and 2.12 versions have the needed compatibility code in this package. | ||
### New collections | ||
|
||
The library also adds backported versions of new collection types, such as `immutable.ArraySeq` and `immutable.LazyList`. (On 2.13, these types are just aliases to standard library types.) | ||
|
||
And it adds backported versions of some 2.13 collections methods such as `maxOption`. | ||
### New collection methods | ||
|
||
Support is included for some 2.13 collections methods such as `maxOption`. | ||
|
||
### Other new classes | ||
|
||
Support is included for some non-collections classes, such as: | ||
|
||
* `@nowarn` annotation, added in 2.13.2 and 2.12.13. (The 2.11 `@nowarn` doesn't do anything, but its presence facilitates cross-compilation.) | ||
|
||
### Other new methods | ||
|
||
Support is included for some other methods, such as: | ||
|
||
And, it includes support for some non-collections classes such as the `@nowarn` annotation added in 2.13.2. | ||
* `toIntOption` (and `Long`, et al) on `String` | ||
|
||
## Migration rules | ||
|
||
|
@@ -68,7 +84,7 @@ scalacOptions += "-P:semanticdb:synthetics:on" | |
```bash | ||
// sbt shell | ||
> scalafixEnable | ||
> scalafixAll dependency:[email protected]:scala-collection-migrations:<version> | ||
> scalafixAll dependency:[email protected]:scala-collection-migrations:<version> | ||
``` | ||
|
||
### Collection213CrossCompat | ||
|
@@ -87,7 +103,7 @@ scalacOptions += "-P:semanticdb:synthetics:on" | |
```bash | ||
// sbt shell | ||
> scalafixEnable | ||
> scalafixAll dependency:[email protected]:scala-collection-migrations:<version> | ||
> scalafixAll dependency:[email protected]:scala-collection-migrations:<version> | ||
``` | ||
|
||
### Fixing unused import warnings | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.