-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Requestify Inferring Generic Requirements #26995
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
Unify a bunch of quasi-independent callsites into a single request that builds up a generic signature from a variety of inference sources. This draws the extension typealias workaround for SE-0229 into TypeCheckDecl where we can better work on refactoring it. The goal is to use this as a springboard to requests that compute generic environments for various and sundry decls.
f22a2c7
to
87047d0
Compare
Unfortunately, only code structure improvements in this one. No perf improvements from laziness - seems like we were already doing a pretty good job of minimizing our construction of GSBs here. |
@swift-ci please test |
auto sig = nominal->getGenericSignatureOfContext(); | ||
if (!sig) return static_cast<unsigned>(-1); | ||
|
||
return sig->getGenericParams().back()->getDepth(); |
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.
return nominal->getGenericContextDepth();
?
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 don't think we need a context walk here if we already have this information available in this (admittedly baroque) form. There's quite a few places in the compiler that are computing depths this way. Perhaps we should look into unifying them.
Build failed |
Build failed |
@swift-ci please test |
⛵️ |
Unify a bunch of quasi-independent callsites into a single request that
builds up a generic signature from a variety of inference sources. This
draws the extension typealias workaround for SE-0229 into TypeCheckDecl
where we can better work on refactoring it. The goal is to use this as
a springboard to requests that compute generic environments for various
and sundry decls.