-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CSDiag] Start chipping away at FailureDiagnosis::diagnoseAmbiguity #29415
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
@swift-ci please smoke test |
Next to go is ambiguity due to unresolved member references for cases like: func f(_: Int) {}
func f(_: String) {}
f(.nothing) Currently working on generalizing the strategy in |
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.
Looks great! I just have a slight concern about a new hole.
.highlight(E->getSourceRange()); | ||
return; | ||
} | ||
|
||
// Diagnose ".foo" expressions that lack context specifically. | ||
if (auto UME = | ||
dyn_cast<UnresolvedMemberExpr>(E->getSemanticsProvidingExpr())) { |
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.
Btw, I think this should be obsolete as well because diagnostics for _ = .foo
have been ported already as missing base type for unresolved member.
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.
It isn't yet :/ it's still handling cases like this, where the solver does find multiple solutions with fixes but it isn't yet diagnosed in diagnoseAmbiguityWithFixes
:
func f(_: Int) {}
func f(_: String) {}
f(.nothing)
I'm currently working on this case 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.
Ah, that comment on top threw me off :)
Remove some special cases in
FailureDiagnosis::diagnoseAmbiguity
, including:_
. Find solutions using holes for the type of the invalid underscore.