-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[CS] Handle holes in mergeEquivalenceClasses
#83724
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
base: main
Are you sure you want to change the base?
Conversation
5fba3d7 to
2fa4b46
Compare
mergeEquivalenceClassesmergeEquivalenceClasses
| Table(self.data) { | ||
| // expected-error@-1 {{expected expression of type 'Columns' in result builder 'TableColumnBuilder'}} {{23-23=<#T##Columns#>}} | ||
| // expected-error@-1 {{expected expression of type 'Column' in result builder 'TableColumnBuilder'}} {{23-23=<#T##Column#>}} | ||
| // expected-error@-2 {{generic parameter 'Column' could not be inferred}} |
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 a little unfortunate, but it's because we're now no longer stripping TVO_CanBindToHole from the generic parameter. We can't eagerly bind the missing argument to a hole because we rely on type inference to infer the type for better diagnostics. Maybe we could rework those diagnostics to instead look at the parameter type, or maybe we could tweak the diagnostic logic for a defaulted generic parameter to account for missing argument fixes (unfortunately it currently gets defaulted before we match arguments though). In any case, I'm going to leave this as future work.
|
@swift-ci please SourceKit stress test |
We know this is where the issue is so we ought to always produce a concrete hole.
Unwrap a metatype before checking if we have an associated fix.
Make sure we preserve `TVO_CanBindToHole`. This unfortunately requires introducing the concept of a "non-representative" hole for representatives where the actual hole is given by another type variable in the equivalence class. This avoids disturbing binding order and regressing diagnostics. Once binding is less sensitive to ordering we ought to be able to always choose the hole as the representative.
2fa4b46 to
d8719ab
Compare
|
@swift-ci please test |
|
Oh fun this breaks swift-testing on Windows |
Make sure we preserve
TVO_CanBindToHole. This unfortunately requires introducing the concept of a "non representative" hole for representatives where the actual hole is given by another type variable in the equivalence class. This avoids disturbing binding order and regressing diagnostics. Once binding is less sensitive to ordering we ought to be able to always choose the hole as the representative.