-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Remove unnecessary type parameter on IterableOnce#stepper
#8083
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
Remove unnecessary type parameter on IterableOnce#stepper
#8083
Conversation
Huh, that's unexpected. The method was
|
The MiMa change is due to specialization: $ jardiff -c $(scala-classpath $(scala-ref-version 90491f5~1)) $(scala-classpath $(scala-ref-version 90491f5))
...
diff --git a/scala/jdk/Accumulator.class.asm b/scala/jdk/Accumulator.class.asm
index ca5cb79..935cf3a 100644
--- a/scala/jdk/Accumulator.class.asm
+++ b/scala/jdk/Accumulator.class.asm
@@ -401,27 +401,9 @@
// parameter final p
// access flags 0x401
- // signature <B:Ljava/lang/Object;S::Lscala/collection/Stepper<*>;>(Lscala/collection/StepperShape<TB;TS;>;)TS;
- // declaration: S <B, S extends scala.collection.Stepper<?>>(scala.collection.StepperShape<B, S>)
+ // signature <S::Lscala/collection/Stepper<*>;>(Lscala/collection/StepperShape<TA;TS;>;)TS;
+ // declaration: S <S extends scala.collection.Stepper<?>>(scala.collection.StepperShape<A, S>)
public abstract efficientStepper(Lscala/collection/StepperShape;)Lscala/collection/Stepper;
- // parameter final shape
-
- // access flags 0x1
- // signature <B:Ljava/lang/Object;S::Lscala/collection/Stepper<*>;>(Lscala/collection/StepperShape<TB;TS;>;)TS;
- // declaration: S <B, S extends scala.collection.Stepper<?>>(scala.collection.StepperShape<B, S>)
- public efficientStepper$mcD$sp(Lscala/collection/StepperShape;)Lscala/collection/Stepper;
- // parameter final shape
-
- // access flags 0x1
- // signature <B:Ljava/lang/Object;S::Lscala/collection/Stepper<*>;>(Lscala/collection/StepperShape<TB;TS;>;)TS;
- // declaration: S <B, S extends scala.collection.Stepper<?>>(scala.collection.StepperShape<B, S>)
- public efficientStepper$mcI$sp(Lscala/collection/StepperShape;)Lscala/collection/Stepper;
- // parameter final shape
-
- // access flags 0x1
- // signature <B:Ljava/lang/Object;S::Lscala/collection/Stepper<*>;>(Lscala/collection/StepperShape<TB;TS;>;)TS;
- // declaration: S <B, S extends scala.collection.Stepper<?>>(scala.collection.StepperShape<B, S>)
- public efficientStepper$mcJ$sp(Lscala/collection/StepperShape;)Lscala/collection/Stepper;
// parameter final shape
// access flags 0x1
@@ -1204,28 +1186,10 @@
// declaration: int <B>()
public startsWith$default$2()I
- // access flags 0x1
- // signature <B:Ljava/lang/Object;S::Lscala/collection/Stepper<*>;>(Lscala/collection/StepperShape<TB;TS;>;)TS;
- // declaration: S <B, S extends scala.collection.Stepper<?>>(scala.collection.StepperShape<B, S>)
- public stepper(Lscala/collection/StepperShape;)Lscala/collection/Stepper;
- // parameter final shape
-
- // access flags 0x1
- // signature <B:Ljava/lang/Object;S::Lscala/collection/Stepper<*>;>(Lscala/collection/StepperShape<TB;TS;>;)TS;
- // declaration: S <B, S extends scala.collection.Stepper<?>>(scala.collection.StepperShape<B, S>)
- public stepper$mcD$sp(Lscala/collection/StepperShape;)Lscala/collection/Stepper;
- // parameter final shape
-
- // access flags 0x1
- // signature <B:Ljava/lang/Object;S::Lscala/collection/Stepper<*>;>(Lscala/collection/StepperShape<TB;TS;>;)TS;
- // declaration: S <B, S extends scala.collection.Stepper<?>>(scala.collection.StepperShape<B, S>)
- public stepper$mcI$sp(Lscala/collection/StepperShape;)Lscala/collection/Stepper;
- // parameter final shape
-
- // access flags 0x1
- // signature <B:Ljava/lang/Object;S::Lscala/collection/Stepper<*>;>(Lscala/collection/StepperShape<TB;TS;>;)TS;
- // declaration: S <B, S extends scala.collection.Stepper<?>>(scala.collection.StepperShape<B, S>)
- public stepper$mcJ$sp(Lscala/collection/StepperShape;)Lscala/collection/Stepper;
+ // access flags 0x11
+ // signature <S::Lscala/collection/Stepper<*>;>(Lscala/collection/StepperShape<TA;TS;>;)TS;
+ // declaration: S <S extends scala.collection.Stepper<?>>(scala.collection.StepperShape<A, S>)
+ public final stepper(Lscala/collection/StepperShape;)Lscala/collection/Stepper;
// parameter final shape
// access flags 0x1 |
@@ -84,8 +84,8 @@ trait StreamExtensions { | |||
|
|||
implicit class MapHasParKeyValueStream[K, V, CC[X, Y] <: collection.MapOps[X, Y, CC, _]](cc: CC[K, V]) { | |||
private type MapOpsWithEfficientKeyStepper[K, V] = collection.MapOps[K, V, CC, _] { def keyStepper[S <: Stepper[_]](implicit shape : StepperShape[K, S]) : S with EfficientSplit } |
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.
Is the shadowing of K and V here intended?
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.
Maybe not intended, but it's not a bug :-)
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.
@szeiger could you appease mima, perhaps also rebase to avoid potential conflict? |
90491f5
to
4b00073
Compare
did the rebase |
Looks like this also has a junit test failure? |
This also requires a contravariant `StepperShape`. Without this change it is impossible to delegate easily (without casting) from such a `stepper` implementation to one without the extra type parameter (see `StepperTest`). It also makes the signatures less ugly.
4b00073
to
f3b3f9a
Compare
Oh no! No, no, no, no, no. This PR broke Scala.js 0.6.28, which I had specifically released to support 2.13. It triggers a compilation error in the file
Is there anything that can be done on Scala's side to fix this? Because otherwise I'll despair at having to re-do yet another release in emergency mode (and I really don't have time for this now, with Scala Days approaching). |
I can't think of anything except for reverting this PR or delaying the RC. (EDIT: more inclined towards the latter, as this PR was the whole reason for doing RC3) |
Well, I think what I'll do is cheat. I will live-patch |
Ok, let me know if there's something we can do to make this annoyance somewhat less annoying. We're all really eager to get that final release out the door! |
Nah, I don't think there's anything that can be done. Just ship it. |
Ported from scala/scala#8083 upstream.
Ported from scala/scala#8083 upstream.
This also requires a contravariant
StepperShape
. Without this change it is impossible to delegate easily (without casting) from such astepper
implementation to one without the extra type parameter (seeStepperTest
). It also makes the signatures less ugly.