Skip to content

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

Merged
merged 2 commits into from
Sep 5, 2019

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Sep 3, 2019

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.

@CodaFi CodaFi requested a review from DougGregor September 3, 2019 16:54
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.
@CodaFi CodaFi force-pushed the a-sign-from-on-high branch from f22a2c7 to 87047d0 Compare September 3, 2019 16:56
@CodaFi
Copy link
Contributor Author

CodaFi commented Sep 3, 2019

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.

@CodaFi
Copy link
Contributor Author

CodaFi commented Sep 3, 2019

@swift-ci please test

auto sig = nominal->getGenericSignatureOfContext();
if (!sig) return static_cast<unsigned>(-1);

return sig->getGenericParams().back()->getDepth();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return nominal->getGenericContextDepth(); ?

Copy link
Contributor Author

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.

@swift-ci
Copy link
Contributor

swift-ci commented Sep 3, 2019

Build failed
Swift Test OS X Platform
Git Sha - 87047d0

@swift-ci
Copy link
Contributor

swift-ci commented Sep 3, 2019

Build failed
Swift Test Linux Platform
Git Sha - 87047d0

@CodaFi
Copy link
Contributor Author

CodaFi commented Sep 3, 2019

@swift-ci please test

@CodaFi
Copy link
Contributor Author

CodaFi commented Sep 5, 2019

⛵️

@CodaFi CodaFi merged commit 07bcf5a into swiftlang:master Sep 5, 2019
@CodaFi CodaFi deleted the a-sign-from-on-high branch September 5, 2019 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants