Skip to content

[Serialization] Drop decls whose types can't be deserialized. #8933

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

Conversation

jrose-apple
Copy link
Contributor

@jrose-apple jrose-apple commented Apr 22, 2017

This shouldn't be common—renames are far more likely, and those we can track—but occurs when the swift_wrapper attribute (the implementation of NS_STRING_ENUM) is active in Swift 4 but not in Swift 3.

Note that this only checks the canonical interface type of the declaration, because the non-canonical type may contain references to the declaration's generic parameters.

@jrose-apple jrose-apple force-pushed the check-the-type-before-you-decl branch from 391ad61 to 5748ae8 Compare April 22, 2017 00:11
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

The next commits will need access from ModuleFile.cpp.

Also stop pretending we care what kind of error we got back, or that
we might get back random other errors that weren't accounted
for. That's good for crash logs, but not actually interesting here.
(Nearly every place that previously looked for OverrideError will
also accept the upcoming TypeError.)

No effective functionality change.
Proof-of-concept for the above. This shouldn't be common---renames are
far more likely, and those we can track---but occurs when the
swift_wrapper attribute (the implementation of NS_STRING_ENUM) is
active in Swift 4 but not in Swift 3.

Note that this only checks the canonical interface type of the
declaration, because the non-canonical type may contain references to
the declaration's generic parameters.
If there's an error deserializing part of a type, just propagate it
out. Also add support for bound generic types. This isn't meant to be
full coverage of possible failures, just ones that are likely to come
up through the C/ObjC importer.

Still to do:
- Generic function types (only show up on functions)
- Unbound generic types (only show up on typealiases, which I may not
  even tackle)
This doesn't handle generic functions with problems in their
requirements, but it's a step.
Finishes up the "big four" non-type decl kinds. Unfortunately,
indiscriminately dropping members from a class affects the layout
of its vtable. That issue is tracked by rdar://problem/31878396.
If a base method's not available, we already drop the overridding
method. Make sure this works even when the base method is itself
an override that failed to load.
@jrose-apple jrose-apple force-pushed the check-the-type-before-you-decl branch from 5748ae8 to 5344d16 Compare April 28, 2017 01:39
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple jrose-apple merged commit 06c3c99 into swiftlang:master Apr 28, 2017
@jrose-apple jrose-apple deleted the check-the-type-before-you-decl branch April 28, 2017 02:39
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.

1 participant