-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[NFC] Refactor Subscript Expr Rebuilding a Bit #28809
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
Have callers resolve the SelectedOverload instead of the callee. Then make the error paths more apparent, and flush Optional<SelectedOverload> wherever it can be found.
@swift-ci please smoke test |
// have a proper overload selected from subscript call, might be because | ||
// solver was allowed to return free or unresolved types, which can | ||
// happen while running diagnostics on one of the expressions. | ||
if (!overload) { |
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.
@xedin A quick grep reveals we have no tests that emit these diagnostics. Should this just use getOverloadChoice
?
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 like there are some in d111e9b but they are crash tests so diagnostic is not verified. I have ran a couple with -debug-constraints
and it looks like new framework is handling them well now, so I'd say let's remove this logic from here and maybe assert instead?
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.
Confirmed, this passes the compiler crasher suite.
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.
Great!
@swift-ci please smoke test |
f6daec7
to
7dd429b
Compare
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
⛵️ |
Const-qualify the members of
SelectedOverload
and change up the interface to the subscript-y bits of CSApply so it's a bit clearer what all they're doing with it. This pushes the failure path up and out to its callers, where it's now apparent that onlyvisitSubscriptExpr
ever needed to use it. As it's CSApply's responsibility to createDynamicSubscriptExpr
s - we'd be in quite a lot of trouble if we somehow were able to build one then lost the overload that got us there.