-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #16654 and partially fix #16583 #17592
Conversation
37e4f87
to
b9bfde7
Compare
library/src/scala/Tuple.scala
Outdated
@@ -13,9 +13,9 @@ sealed trait Tuple extends Product { | |||
runtime.Tuples.toArray(this) | |||
|
|||
/** Create a copy of this tuple as a List */ | |||
inline def toList: List[Union[this.type]] = | |||
inline def toList[This >: this.type <: Tuple]: List[Union[This]] = |
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.
This is not backward tasty compatible, unfortunately.
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.
Does it mean it should be merged after the next minor release only, or that we can't do that at all?
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.
We cannot do it at all.
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.
Too bad 🥲
We have the same problem for Tuple.map
by the way: #15992 (comment).
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.
how can we sensibly improve API's known to be broken? to we need to add an .api2
method to Tuple which returns an object with all the fixed APIs?
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.
The only true way is not to introduce broken APIs in the first place ... which means more testing when they are introduced. Of course that's too late for what's already published.
It might be possible to pull off something once @binaryAPI
is introduced. As we could keep the broken version as @binaryAPI private[Tuple]
and introduce the fixed version as public.
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.
As we could keep the broken version as @binaryapi private[Tuple] and introduce the fixed version as public.
I thought when inlining that would fail the accessibility check, as it would already be resolved to the specific overload? - would rechecks ignore @binaryAPI
?
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.
Accessibility from tasty is already relaxed to a degree.
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.
Suggestion from Martin: deprecate Tuple.toList
and replace it with a new Tuple.toIterator
that has a type parameter.
Not sure what to do for Tuple.map
.
Following the discussion above, I rolled back the change to the signature of As a result, while all other tests and minimization of #16583 are fixed by the inline def labels[Labels <: Tuple](using ev: Tuple.Union[Labels] <:< String): List[String] =
val tmp = constValueTuple[Labels].toList
ev.substituteCo( tmp )
This makes sense. Not sure how we could fix this without changing the signature of Writing the expected type of val tmp: List[Tuple.Union[Labels]] = (constValueTuple[Labels]: Labels).toList
|
Note: I kept individual commits for now to ease reviews, but will rebase to 2 commits ( |
I have dismissed my earlier review since the API does not change anymore. However, I am woefully unqualified to sign off on the changes that do remain in the PR, so I'll refrain from posting a new review. |
Failing community test:
At first sight, that's another case wher a type application argument is a skolem of an abstract type, resulting in the application being approximated. This is similar to the |
Co-Authored-By: Guillaume Martres <[email protected]> Co-Authored-By: Dale Wijnand <[email protected]> Co-Authored-By: Decel <[email protected]>
Revert "Normalize types in compareAtoms" This reverts commit 1b52634. f Co-Authored-By: Dale Wijnand <[email protected]>
Co-Authored-By: Dale Wijnand <[email protected]>
Co-Authored-By: Dale Wijnand <[email protected]>
There's too much going on in this PR I think, can we split the AllowLambdaWildcardApply change in its own PR so we can evaluate it separately? |
Found a way to make it all work, changing less: #18043 |
Let's try to get #18043 merged first, and then to address the |
Fixes #16654 and part of #16583.