-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
Fix getOrElse
type inference issue in Scala 3, closes #2761
#2803
Conversation
I'm confused, I thought it's fixed in M4? |
I don't either know offhand exactly what Unconst is for, but with this change its name is no longer accurate. |
Incompatible changesslick3 changes since 3.5.0-pre.56.04ce9b09 Code changes
|
oh, i get it, |
Incompatible changesslick3 changes since 3.5.0-pre.62.ed0ba56a Code changes
|
Incompatible changesslick3 changes since 3.5.0-pre.66.a3e77c60 Code changes
|
With the new definition of Unconst it seems pointless. Is it really needed? |
or maybe scala 2 should keep |
Unconst is only used in getOrElse, where it says def getOrElse[M, P2 <: P](default: M)(implicit shape: Shape[FlatShapeLevel, M, ?, P2], ol: OptionLift[P2, O]): ShapedValue.Unconst[P, P2] = {
// P2 != P can only happen if M contains plain values, which pack to ConstColumn instead of Rep.
// Both have the same packedShape (RepShape), so we can safely cast here:
val r = fold[P, P](shape.pack(default): P)(identity)(shape.packedShape.asInstanceOf[Shape[FlatShapeLevel, P, ?, P]])
r.asInstanceOf[ShapedValue.Unconst[P, P2]]
} I don't understand the comment. Also since that's the only place it's used I don't know why it's in ShapedValue. |
I mean if you always return P then get rid of Unconst and just do |
You could go for the full implication of this change. But have you tried other ways, like adding other match cases or something? Also what happens if you keep your change but don't change the P2s to P? Also what happens if scala 2 would use P2? |
|
in fact removing P2 entirely seems to be harmless |
Incompatible changesslick3 changes since 3.5.0-pre.68.610c46f8 Code changes
|
Incompatible changesslick3 changes since 3.5.0-pre.76.da631720 Code changes
|
@nafg i did some cleanup, and think it is ready to be merged |
Incompatible changesslick3 changes since 3.5.0-pre.110.88b2ffb1 Code changes
|
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.
Sorry for the delay, I probably had feedback that I don't recall but I want to do another milestone release so let's just get it in
Incompatible changesslick3 changes since 3.5.0-pre.118.137bf069 Code changes
|
Incompatible changesslick3 changes since 3.5.0-pre.122.6896ef03 Code changes
|
Note: I have no idea what
Unconst
is doing but this fixes the issue