Skip to content

[ABI] Add default associated type witnesses to resilient protocols. #19336

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
Sep 16, 2018

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Sep 15, 2018

When an associated type witness has a default, record that as part of
the protocol and emit a default associated type metadata accessor into the
default witness table. This allows a defaulted associated type to be
added to a protocol resiliently.

This is another part of rdar://problem/44167982, but it’s still very
limiting because the new associated type cannot have any conformances.

@DougGregor DougGregor force-pushed the associated-type-defaults branch from 3861687 to 204af17 Compare September 15, 2018 06:05
@DougGregor
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 204af17cbb934969e03f2783d0610c489607f599

Put a DenseMap onto the ASTContext’s implementation instead.
SILWitnessTable::Entry already contains a superset of what was supported
by SILDefaultWitnessTable::Entry, the latter of which only had “no entry”
and “method” states. Make SILDefaultWitnessTable::Entry an alias for
SILWitnessTable::Entry, and unify all of the parsing/printing/
(de)serialization logic.
When an associated type witness has a default, record that as part of
the protocol and emit a default associated type metadata accessor into the
default witness table. This allows a defaulted associated type to be
added to a protocol resiliently.

This is another part of rdar://problem/44167982, but it’s still very
limiting because the new associated type cannot have any conformances.
There is no good way to do this, so take a shortcut for now of 
pre-resolving ‘Self’.
@DougGregor DougGregor force-pushed the associated-type-defaults branch from 204af17 to ccb1c9a Compare September 16, 2018 05:05
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 72c5367 into swiftlang:master Sep 16, 2018
@DougGregor DougGregor deleted the associated-type-defaults branch September 16, 2018 14:28
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