-
Notifications
You must be signed in to change notification settings - Fork 10.6k
AST: Rename mapTypeIntoContext() => mapTypeIntoEnvironment(), mapTypeOutOfContext() => mapTypeOutOfEnvironment() #85459
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
AST: Rename mapTypeIntoContext() => mapTypeIntoEnvironment(), mapTypeOutOfContext() => mapTypeOutOfEnvironment() #85459
Conversation
|
swiftlang/llvm-project#11809 |
kavon
left a comment
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 a good idea.
…OutOfContext() => mapTypeOutOfEnvironment()
…nment(), mapReplacementTypesOutOfContext() => subs.mapReplacementTypesOutOfEnvironment()
| if (auto *AFD = TheFunction.dyn_cast<AbstractFunctionDecl *>()) { | ||
| if (auto *FD = dyn_cast<FuncDecl>(AFD)) | ||
| return FD->mapTypeIntoContext(FD->getResultInterfaceType()); | ||
| return FD->mapTypeIntoEnvironment(FD->getResultInterfaceType()); |
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.
@slavapestov is the generics book going to need another update? 😄 – but more seriously, what's the rename motivation? is 'context' too overloaded?
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.
Yes, I'll upload a new version of chapters/archetypes.tex next time around. The motivation for the rename is that "context" is too overloaded, yeah. See the PR description
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, my bad – i think i saw the PR before it had a description 🙈
146b205 to
64f2d1a
Compare
|
swiftlang/llvm-project#11809 |
The thing being mapped into and out of is
GenericEnvironment, and notGenericContext(the latter exists, but it's aDeclContextsubclass that's mostly internal to a few things in the AST). Let's rename these operations since "context" is already a highly overloaded term, and it's clearer if people talk about "mapping types into a generic environment", etc, since then we know exactly what is being referred to.