-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Scala 2.13.0-M4 in all the non-tools artifacts.
This commit puts the codebase in a state where we can build the compiler plugins, libraries and test suite with Scala 2.13.0-M4 and its new collections. The tools API and related artifacts are not yet updated. This is the minimal set of changes necessary to be able to build and back-publish for 2.13.0-M4 when it comes out. We will not be able to publish tools artifact for that version, but that is not critical.
- Loading branch information
Showing
53 changed files
with
2,043 additions
and
932 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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package java.util | ||
|
||
import scala.collection.mutable | ||
|
||
/** Make some Scala 2.13 APIs available in older Scala versions. */ | ||
private[util] object Compat { | ||
|
||
/** Adds methods from 2.13 to `SortedSet`. | ||
* | ||
* The `to` operation has been renamed to `rangeTo` in 2.13, to not | ||
* conflict with the `to` operation in `Iterable`. | ||
*/ | ||
implicit class SortedSetCompat[A](val __private_self: mutable.SortedSet[A]) | ||
extends AnyVal { | ||
|
||
@inline private def self: mutable.SortedSet[A] = __private_self | ||
|
||
/* Note: the double implicit conversion trick does not work here because | ||
* there *is* a `to` method in 2.13 (but it takes a `Factory` as parameter) | ||
* so the second implicit conversion is never triggered. | ||
*/ | ||
def rangeTo(to: A): mutable.SortedSet[A] = { | ||
// Implementation copied from 2.12's implementation | ||
val i = self.rangeFrom(to).iterator | ||
if (i.isEmpty) { | ||
self | ||
} else { | ||
val next = i.next() | ||
if (self.ordering.compare(next, to) == 0) { | ||
if (i.isEmpty) self | ||
else self.rangeUntil(i.next()) | ||
} else { | ||
self.rangeUntil(next) | ||
} | ||
} | ||
} | ||
|
||
/* Note: the double implicit conversion trick does not work here either | ||
* because the `from` and `until` methods still exist on 2.13 but they | ||
* are deprecated. | ||
*/ | ||
def rangeFrom(a: A): mutable.SortedSet[A] = self.rangeImpl(Some(a), None) | ||
def rangeUntil(a: A): mutable.SortedSet[A] = self.rangeImpl(None, Some(a)) | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.