Skip to content

Conversation

hamzaremmal
Copy link
Member

@hamzaremmal hamzaremmal commented Sep 24, 2025

This is the first sync between the stdlib of scala 2 and scala 3 after merging the histories.
The steps to reproduce this:

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 sync-stdlib
git push scala3

This was done manually, when I have some free time, I will make a workflow to automatically do this.

lrytz and others added 30 commits February 21, 2023 13:40
…r-slice

Improve check for empty vector slice
Lint for integral divisions that are widened to a float [forward port from 2.12]
Signed-off-by: Liang Yan <ckgppl_yan@sina.cn>
This fixes scala/bug#8938 for Scala 2.12 in a way that is compatible with the behavior of 2.13 introduced in 4a4dd1d.

- Relevant test suite parts taken verbatim from the 2.13 version, with one exception: I did not modify the messages of wrapped exceptions, therefore PromiseTests expects the name "Boxed InterruptedException" (as used in `Promise.resolver` in 2.12) instead of "Boxed Exception".
- The actual implementation is not based on 2.13, which was a major rewrite that cannot be applied cleanly to 2.12 and is not fully source or binary compatible. Instead I implemented a strategic fix in as simple a way as possible.
Seq.isEmpty is lengthCompare and IndexedSeq
has efficient length aka knownSize. headOption
already uses isEmpty.
This is a follow-up of the comment in
#15766 (comment)
to try and make it clear to Scala 3 users that while this API exists and
is visible in Scala 3, it's not supported by the actual compiler.
Therefore it's recommended to instead use the `inline if` alternative.
This just adds a note to the Scaladoc to that effect.

refs: #15766
If the new elements are added to the end, `last0` needs to be
updated.

`insertAfter` is used in `patchInPlace` and `insertAll`, but the bug
didn't manifest for `insertAll` because it delegates to `addAll` when
adding to the end.
When converter destination collection does not have equality defined, we
should override equals/hashcode. 2 wrappers with same underlying
collection should be equal.
Add explicit result type to methods where Scala 2 and Scala 3
disagree with the inferred type. The aim is to have the same type in
the Scala 2 pickles and the Scala 3 TASTy.

These where identified in #17975
IndexedSeq.head throws NoSuchElementException
…result-types

Add explicit result type to some non-private methods
Fix ListBuffer.insertAfter, used in patchInPlace
som-snytt and others added 16 commits May 19, 2025 07:24
Comment on private ListBuffer.locate [ci: last-only]
…sage

Use List.fill instead of range [ci: last-only]
…array

IterableOnce#copyToArray uses helper for count [ci: last-only]
This fixes scala/scala#13108 when comparing Seq[Float] with Seq[Float] it expected
that Float.NaN != Float.NaN and 0.0 equals -0.0f. But before this patch
this was violated by ArraySeq.ofFloat/ofDouble
Fix ArraySeq.ofFloat/ofDouble.equals for floating point
Extract branches to be mostly dependent on `isInclusive` and
`step >= 0`. These are often constant, and when they're not
statically constant, they are probably predictable anyway.

This commit upstreams
scala-js/scala-js@a5337ed
from Scala.js.
Previously, `Range` used a number of intermediate operations on
`Long`s to avoid overflow. We can streamline a lot of code by
using unsigned `Int` arithmetics. In particular, there is only 1
division in the initialization path, instead of 3.

Although the fields have not changed, the content of
`numRangeElements` is more strict for overfull ranges. This means
that deserializing an overfull range from a previous version would
not be safe. This is why we bump the SerialVersionUID.

This commit upstreams
scala-js/scala-js@d972218
from Scala.js.
Avoid evaluating `value0` twice on completed Futures for performance.
perf: avoid double checking `value0` Future.
@hamzaremmal hamzaremmal self-assigned this Sep 24, 2025
@hamzaremmal hamzaremmal deleted the sync-stdlib branch September 24, 2025 18:57
@hamzaremmal hamzaremmal restored the sync-stdlib branch September 24, 2025 19:00
@hamzaremmal hamzaremmal reopened this Sep 24, 2025
@hamzaremmal hamzaremmal changed the base branch from main to sync-scala-library September 24, 2025 19:00
@hamzaremmal
Copy link
Member Author

I'm starting over.

@hamzaremmal hamzaremmal deleted the sync-stdlib branch September 24, 2025 19:01
@hamzaremmal hamzaremmal restored the sync-stdlib branch September 24, 2025 19:09
@hamzaremmal hamzaremmal deleted the sync-stdlib branch September 25, 2025 08:17
hamzaremmal added a commit that referenced this pull request Sep 25, 2025
Superseed #24062 

Steps to reproduce:

```shell
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
git replace --graft b594c22eac364ca2449a2700506b4f6b3f571b86 2308509
git filter-repo --proceed
git checkout -b stdlib-history
git checkout -b sync-24-09-2025 scala3/main
git merge stdlib-history # Also fix the two conflicts that occurred
git push scala3
```
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.