Skip to content

Fix #22794: Emit the definition of Arrays.newArray even though it's a primitive. #22797

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

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Mar 13, 2025

Until 3.6.x, we used the user-space definition of Arrays.newArray in Scala.js. We changed it to a primitve in
2852168, to match the behavior of the JVM backend.

However, that had the side effect of not emitting its definition at all, like other primitives. For backward binary compat reasons, we do need that definition.

We specifically make an exception for that method, which is now emitted, even though it is otherwise treated as a primitive.


Needs to be backported to the 3.7.0-x branch.

… it's a primitive.

Until 3.6.x, we used the user-space definition of `Arrays.newArray`
in Scala.js. We changed it to a primitve in
2852168, to match the behavior of
the JVM backend.

However, that had the side effect of not emitting its definition
at all, like other primitives. For backward binary compat reasons,
we do need that definition.

We specifically make an exception for that method, which is now
emitted, even though it is otherwise treated as a primitive.
@sjrd sjrd added the backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" label Mar 13, 2025
@sjrd sjrd requested a review from Gedochao March 13, 2025 16:09
@sjrd sjrd changed the title Fix #22794: Emit the definition of Arrays.newArray even though it's… Fix #22794: Emit the definition of Arrays.newArray even though it's a primitive. Mar 13, 2025
@sjrd sjrd merged commit 596538b into scala:main Mar 13, 2025
29 checks passed
@sjrd sjrd deleted the sjs-fix-newarray-backward-compat branch March 13, 2025 19:09
@sjrd
Copy link
Member Author

sjrd commented Mar 13, 2025

/cc @WojciechMazur to backport to the 3.7.0 release branch. It fixes a critical regression that makes Scala.js basically unusable in 3.7.0-RC1.

WojciechMazur added a commit that referenced this pull request Mar 14, 2025
…ugh it's a primitive." to 3.7.0 (#22801)

Backports #22797 to Scala 3.7.0-RC2
@WojciechMazur WojciechMazur added backport:done This PR was successfully backported. and removed backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" labels Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:done This PR was successfully backported.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants