Skip to content

[Archetype builder] Simplify/improve handling of typealiases in protocols #6038

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 5 commits into from
Dec 3, 2016

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Dec 2, 2016

PotentialArchetype::getNestedType() was effectively reimplementing a
simplified form of mapTypeOutOfContext(), missing some cases in the
process. Just use mapTypeOutOfContext() and resolveArchetype(). While
here, stop re-implementing the addSameType* operations; just call them
directly. With these changes, we no longer need the "typealias in
protocol is too complex" diagnostic, and a couple of crashers were fixed along the way.

My actual goal here is to kill off DeclContext::getSelfTypeInContext(), but this turned out to be an important step along the way.

PotentialArchetype::getNestedType() was effectively reimplementing a
simplified form of mapTypeOutOfContext(), missing some cases in the
process. Just use mapTypeOutOfContext() and resolveArchetype(). While
here, stop re-implementing the addSameType* operations; just call them
directly. With these changes, we no longer need the "typealias in
protocol is too complex" diagnostic.

Eliminates another use of getSelfTypeInContext().
Use them to eliminate some more instances of getSelfTypeInContext().
@DougGregor
Copy link
Member Author

FYI @gregomni, you might be interested in this cleanup

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 23e7451 into swiftlang:master Dec 3, 2016
@DougGregor DougGregor deleted the archetypebuilder-typealias branch December 3, 2016 00:35
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.

2 participants