-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Diagnostics] Finish porting subscript errors #29065
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
to diagnose ambiguities due to missing arguments.
@swift-ci please smoke test |
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 great, thank you!
lib/Sema/CSGen.cpp
Outdated
ValueDecl *decl = nullptr; | ||
if (expr->hasDecl()) { | ||
decl = expr->getDecl().getDecl(); | ||
if (decl->isInvalid()) | ||
return Type(); | ||
} | ||
|
||
if (auto nilLiteral = dyn_cast<NilLiteralExpr>(expr->getBase())) { |
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'd have to add this similar check to both variants of addMemberRefConstraints
as well which would cover other member references. In that regard maybe it makes sense to extract it into something like bool validateBaseOfMemberRef(Expr *, Diag<void>)
which takes base expression and diagnostic reference?
@swift-ci please smoke test |
5f9086d
to
301ee49
Compare
@swift-ci please smoke test |
general isValidBaseOfMemberRef function.
301ee49
to
7e05667
Compare
@swift-ci please smoke test |
diagnoseAmbiguityWithFixes
diagnoseSubscriptErrors
from CSDiag