-
Notifications
You must be signed in to change notification settings - Fork 396
Rearrange the init sequence of PrimRefs and PrimTypeWithRefs. #5139
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
2afe56d
to
d6f6725
Compare
There seem to also be these mima problems:
Also, the stability check fails. Did we rely on equals from the case class? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this much more.
However, it seems the CI is failing:
- Some additional mima issues on 2.13.x (not a problem)
- Stability test seems to fail 😨
FTR this was the stability diff: $ diff -u test-suite/target/test-suite-stability.js test-suite/js/.2.12/target/scala-2.12/scalajs-test-suite-test-fastopt/main.js
--- test-suite/target/test-suite-stability.js 2025-03-15 08:54:16.533595600 +0100
+++ test-suite/js/.2.12/target/scala-2.12/scalajs-test-suite-test-fastopt/main.js 2025-03-15 08:54:33.831557800 +0100
@@ -402525,9 +402525,9 @@
$c_scm_ArrayOps$ofBoolean.prototype.repr__O = (function() {
return this.scm_ArrayOps$ofBoolean__f_repr;
});
-$c_scm_ArrayOps$ofBoolean.prototype.apply__I__ = (function(index) {
+$c_scm_ArrayOps$ofBoolean.prototype.apply__I__ = (function(idx) {
var this$ = this.scm_ArrayOps$ofBoolean__f_repr;
- return $n(this$).get(index);
+ return $n(this$).get(idx);
});
$c_scm_ArrayOps$ofBoolean.prototype.clone__ = (function() {
if ($is_jl_Cloneable(this)) {
@@ -402758,9 +402758,9 @@
$c_scm_ArrayOps$ofByte.prototype.repr__O = (function() {
return this.scm_ArrayOps$ofByte__f_repr;
});
-$c_scm_ArrayOps$ofByte.prototype.apply__I__ = (function(index) {
+$c_scm_ArrayOps$ofByte.prototype.apply__I__ = (function(idx) {
var this$ = this.scm_ArrayOps$ofByte__f_repr;
- return $n(this$).get(index);
+ return $n(this$).get(idx);
});
$c_scm_ArrayOps$ofByte.prototype.clone__ = (function() {
if ($is_jl_Cloneable(this)) {
@@ -403224,9 +403224,9 @@
$c_scm_ArrayOps$ofDouble.prototype.repr__O = (function() {
return this.scm_ArrayOps$ofDouble__f_repr;
});
-$c_scm_ArrayOps$ofDouble.prototype.apply__I__ = (function(index) {
+$c_scm_ArrayOps$ofDouble.prototype.apply__I__ = (function(idx) {
var this$ = this.scm_ArrayOps$ofDouble__f_repr;
- return $n(this$).get(index);
+ return $n(this$).get(idx);
});
$c_scm_ArrayOps$ofDouble.prototype.clone__ = (function() {
if ($is_jl_Cloneable(this)) {
@@ -403457,9 +403457,9 @@
$c_scm_ArrayOps$ofFloat.prototype.repr__O = (function() {
return this.scm_ArrayOps$ofFloat__f_repr;
});
-$c_scm_ArrayOps$ofFloat.prototype.apply__I__ = (function(index) {
+$c_scm_ArrayOps$ofFloat.prototype.apply__I__ = (function(idx) {
var this$ = this.scm_ArrayOps$ofFloat__f_repr;
- return $n(this$).get(index);
+ return $n(this$).get(idx);
});
$c_scm_ArrayOps$ofFloat.prototype.clone__ = (function() {
if ($is_jl_Cloneable(this)) {
@@ -403690,9 +403690,9 @@
$c_scm_ArrayOps$ofInt.prototype.repr__O = (function() {
return this.scm_ArrayOps$ofInt__f_repr;
});
-$c_scm_ArrayOps$ofInt.prototype.apply__I__ = (function(index) {
+$c_scm_ArrayOps$ofInt.prototype.apply__I__ = (function(idx) {
var this$ = this.scm_ArrayOps$ofInt__f_repr;
- return $n(this$).get(index);
+ return $n(this$).get(idx);
});
$c_scm_ArrayOps$ofInt.prototype.clone__ = (function() {
if ($is_jl_Cloneable(this)) {
@@ -403926,9 +403926,9 @@
$c_scm_ArrayOps$ofLong.prototype.repr__O = (function() {
return this.scm_ArrayOps$ofLong__f_repr;
});
-$c_scm_ArrayOps$ofLong.prototype.apply__I__ = (function(index) {
+$c_scm_ArrayOps$ofLong.prototype.apply__I__ = (function(idx) {
var this$ = this.scm_ArrayOps$ofLong__f_repr;
- return $n(this$).get(index);
+ return $n(this$).get(idx);
});
$c_scm_ArrayOps$ofLong.prototype.clone__ = (function() {
if ($is_jl_Cloneable(this)) {
@@ -404629,9 +404629,9 @@
$c_scm_ArrayOps$ofUnit.prototype.repr__O = (function() {
return this.scm_ArrayOps$ofUnit__f_repr;
});
-$c_scm_ArrayOps$ofUnit.prototype.apply__I__ = (function(index) {
+$c_scm_ArrayOps$ofUnit.prototype.apply__I__ = (function(idx) {
var this$ = this.scm_ArrayOps$ofUnit__f_repr;
- $n(this$).get(index);
+ $n(this$).get(idx);
});
$c_scm_ArrayOps$ofUnit.prototype.clone__ = (function() {
if ($is_jl_Cloneable(this)) { So it looks to be confined into reflective proxies. It seems they don't have a stable way to choose the parameter names. Giving a stable hash code to Edit, more info: in the IR of def apply;I;B(index: int): byte = {
mod:scala.collection.mutable.ArrayOps$ofByte$.apply$extension;[B;I;B(this.repr;[B(), index)
}
def apply;I;Ljava.lang.Object(idx: int): any = {
mod:scala.collection.mutable.ArrayOps$ofByte$.apply$extension;[B;I;B(this.repr;[B(), idx)
} The second one is a bridge. Normall
8000
y we use a "more specific" test to deterministically choose an overload for the reflective proxy target. Here there is a primitive, and our specificity test does not consider either more specific than the other (this is probably wrong?). So it falls back to the "pick any" criteria of the spec: scala-js/linker/shared/src/main/scala/org/scalajs/linker/analyzer/Analyzer.scala Lines 917 to 923 in 2ed0b39
I guess our "choose arbitrarily" is also "non-deterministically" (unless TypeRef s and therefore MethodName s have stable hash codes)
|
d6f6725
to
5ab874d
Compare
So that it is more obvious that it is not circular. `PrimRef` is not a case class anymore.
5ab874d
to
b1eabac
Compare
Squashed. |
So that it is more obvious that it is not circular.
The second commit is meant to address the comments that were originally reported in #5136.