Skip to content

chore: embed the history of the scala 2 stdlib #23099

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

Draft
wants to merge 8,430 commits into
base: main
Choose a base branch
from
Draft

Conversation

hamzaremmal
Copy link
Member

Here are the steps I followed:

git clone git@github.com:scala/scala.git --single-branch --no-tags --branch 2.13.x embed
cd embed
git filter-repo --path src/library --path-rename src/library:library/src
git filter-repo --message-callback 'return re.sub(rb"(?<!\w)#(\d+)", rb"scala/scala#\1", message)'
git remote add scala3 git@github.com:scala/scala3.git
git fetch scala3 main
git replace --graft b594c22eac364ca2449a2700506b4f6b3f571b86 2308509d2651ee78e1122b5d61b798c984c96c4d
git filter-repo --proceed
git checkout -b embed-stdlib
git push scala3
som-snytt and others added 30 commits December 22, 2022 11:46
Minor refactor in ListSet to foreground guards and add test
in the usual places. based on c4ca300, and verified with
`git grep -w 2022`
…gbuilder-doc

Tweak class doc for StringBuilder
…n-deprecation

Honor more deprecations under separate compilation
…r-slice

Improve check for empty vector slice
lrytz and others added 26 commits February 12, 2025 19:49
Move Future.onCompleteWithUnregister out of the Future API
…list-doc

Boost LazyList Scaladoc just a bit
add documentation for Iterator.indexWhere
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`
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>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment