Skip to content

Handle missing members in protocols as well. #9451

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 6 commits into from
May 11, 2017

Conversation

jrose-apple
Copy link
Contributor

Builds on top of #9360—only the last commit is different.

This means both not crashing when we deserialize the protocol but also emitting correct offsets for dynamic dispatch through the protocol's witness table.

Also fix a bug with vtable and witness table slots for materializeForSet accessors for properties that can't be imported. Because materializeForSet doesn't have the type of the property in its signature, it was taking a different failure path from everything else, and that failure path didn't properly set the name or flags for the missing member.

Finishes rdar://problem/31878396

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

Copy link
Contributor

@jckarter jckarter left a comment

Choose a reason for hiding this comment

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

LGTM.

That is, whether an initializer is 'required', and either does not
override anything or overrides a non-required initializer. We don't
use this for anything now, but it'll show up in the next commit.
They still aren't hooked up to anything yet, but now we can check that
they're showing up where we expect them.
As such, we no longer insert two placeholders for initializers that
need two vtable slots; instead we record that in the
MissingMemberDecl. I can see MissingMemberDecl growing to be something
we'd actually show to users, that can be used for other kinds of
declarations that don't have vtable entries, but for now I'm not going
to worry about any of that.
...which is sufficient to correctly invoke methods in a vtable
even when members have been deleted. 🎉
@jrose-apple jrose-apple force-pushed the protocols-have-tables-too branch from d78d7ae to 32068f3 Compare May 10, 2017 18:59
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

This means both not crashing when we deserialize the protocol but
also emitting correct offsets for dynamic dispatch through the
protocol's witness table.

Also fix a bug with vtable and witness table slots for
materializeForSet accessors for properties that can't be
imported. Because materializeForSet doesn't have the type of the
property in its signature, it was taking a different failure path from
everything else, and that failure path didn't properly set the name or
flags for the missing member.

Finishes rdar://problem/31878396
@jrose-apple jrose-apple force-pushed the protocols-have-tables-too branch from 32068f3 to aeb0fed Compare May 10, 2017 19:43
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple jrose-apple merged commit cbc35f0 into swiftlang:master May 11, 2017
@jrose-apple jrose-apple deleted the protocols-have-tables-too branch May 11, 2017 16:03
jrose-apple added a commit to jrose-apple/swift that referenced this pull request May 11, 2017
…les-too

Handle missing members in protocols as well.
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