-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[stdlib] embed the history of the scala 2 stdlib into dotty's history #23522
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
Minor refactor in ListSet to foreground guards and add test
in the usual places. based on c4ca300, and verified with `git grep -w 2022`
…12.x-to-2.13.x-20230120
…12.x-to-2.13.x-20230120
….13.x-20230120
…gbuilder-doc Tweak class doc for StringBuilder
…rop-on-numeric-ranges Fixes scala/bug#12706
…n-deprecation Honor more deprecations under separate compilation
…r-slice Improve check for empty vector slice
collections Scaladoc: fix an awkward wording
The `ScalaRunTime.wrap*Array` methods are exclusively used by the codegen for varargs. They are always called with fresh (hence non-null) arrays that are non-empty. Therefore, the various code paths handling `null`s and empty arrays were dead code. This commit removes those code paths to simplify those methods and streamline varargs call sites.
…rapping Simplify the run-time wrappers of arrays for use in varargs.
Since 2.13, case class `hashCode` mixes in the hash code of the `productPrefix` string. This is inconsistent with the `equals` method, subclasses of case classes that override `productPrefix` compare equal but have a different `hashCode`. This commit changes `hashCode` to mix in the `productPrefix.hashCode` statically instead of invoking `productPrefix` at runtime. For case classes without primitive fields, the synthetic `hashCode` invokes `ScalaRunTime._hashCode`, which mixes in the result of `productPrefix`. To fix that, the synthetic hashCode is changed to invoke `MurmurHash3.productHash` directly and mix in the name to the seed statically. This works out with keeping `productHash` forwards and backwards compatible. The `MurmurHash3.productHash` method is deprecated / renamed to `caseClassHash`. This method computes the same hash as the synthetic `hashCode`, except for the corner case where a case class (or a subclass) override the `productPrefix`. In this case, the case class name needs to be passed manually to `caseClassHash`.
Change `scala.util.Using` to have `scala.util.control.ControlThrowable` be suppressed by non-fatal exceptions (`scala.util.control.NonFatal`).
Mix in the `productPrefix` hash statically in case class `hashCode`
Improve `s.u.Using` suppression order
The default implementation of `Iterable.sliding` via `Iterator.sliding` is rather inefficient and can benefit greatly from `IndexedSeq`-specific optimizations. The new `IndexedSeqSlidingIterator` provides a `slice`-based implementation of the basic functionality without any of the additional features of `GroupedIterator` (which is only exposed as a return type in `Iterator` but not in `Iterable`). Co-authored-by: Som Snytt <som.snytt@gmail.com>
A fast sliding iterator for IndexedSeqs
Update Option examples to more modern style
…-doc Find more doc vars and distinguish C from CC [ci: last-only]
Allow selector aliasing Drill thru this selections Reduce obsolete use of NoWarnAttachment Use the attachment to avoid warning when the user wrote underscore; the position will be opaque, although the fresh name is longer than the span. For good measure, also avoid warning about fresh names. PatVarDef members warn under -Wunused:patvars Drop local from patvar names No warn if patvar has public accessor Ignore annotation params No warn unit-valued params No warn this is trivial util.WeakHashSet respects load factor
Collect nowarn symbols instead of skipping them
Tweak partial function doc
48b49ff
to
7a75a09
Compare
The CI currently fails because of the way we test the stdlib. Also, we will have to disable the tasty/lib test until we make sure the compiler ignores compiling |
To be able to merge #23522, we need to make some adjustments to the tests and undo them later when the stdlib will be fully independent of scala 2. [skip ci]
34cabba
to
7a75a09
Compare
In this PR, we embed the history of the scala 2 stdlib to Dotty's history.
This is the first real step into producing a fully dotty-compiled stdlib.