-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CSSimplify] Tuple splat should account for single dependent member p… #22960
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
…arameters 12a65ff restricted tuple splat to a single tuple or type variable parameter, but it has to support dependent member types as well because they could be resolved to `Void` (or empty tuple). Resolves: rdar://problem/48443263
@slavapestov Looks like my original fix was a bit overly optimistic, looks like I need to figure out a way to restrict that conversion in |
@swift-ci please test source compatibility |
@swift-ci please test |
_ = S(arr, id: \.self_) { | ||
// expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{30-30=_ in }} | ||
// expected-error@-1 {{type '_' has no member 'self_'}} |
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 think fixing this completely will require not re-typechecking at all. You're replacing the dependent member type with UnresolvedType here.
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.
Actually this error is just unrelated :( C.Element
is resolved properly to Int
later on (on the first solve) so we end up comparing ()
to Int
and failing. I'm trying to think of a way to fix this in salvage
mode. Maybe we shouldn't attempt splat at all, and let fixMissingArgument
and other fixes do their thing, I'll need to add fixes for extraneous and destructuring first though...
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.
Can we try both, build a disjunction with splat and without splat and see what fixes each possibility produces?
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 was thinking about trying to replace argument with type variable and then add conversion constraint to it with original type, this would act similar to disjunction because potential bindings would get both parameter and argument type.
@swift-ci please test source compatibility |
@swift-ci please test macOS platform |
@shahmishal Is there a long macOS CI queue? |
@shahmishal Thanks! |
Build failed |
@swift-ci please test macOS platform |
…arameters
12a65ff restricted tuple splat
to a single tuple or type variable parameter, but it has to
support dependent member types as well because they could be
resolved to
Void
(or empty tuple).Resolves: rdar://problem/48443263