Skip to content

[Serialization] Drop extensions whose requirements are missing types #17488

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 1 commit into from
Jun 26, 2018

Conversation

jrose-apple
Copy link
Contributor

If, for whatever reason, a type used in an extension's generic requirements is missing, just drop the whole extension. This isn't wonderful recovery, but in practice nothing should be able to use the extension anyway, since the relevant type in question is missing.

...Okay, that's not quite true; there could, for example, be inlinable code that references one of these methods. However, that (1) isn't worse than the behavior for any other inlinable code (which doesn't yet attempt to recover from missing declarations), and (2) is still a strict improvement over the current situation, where we will eagerly abort the compiler trying to load the extension in the first place.

rdar://problem/40956460

If, for whatever reason, a type used in an extension's generic
requirements is missing, just drop the whole extension. This isn't
wonderful recovery, but in practice nothing should be able to use the
extension anyway, since the relevant type in question is missing.

...Okay, that's not quite true; there could, for example, be inlinable
code that references one of these methods. However, that (1) isn't
worse than the behavior for any other inlinable code (which doesn't
yet attempt to recover from missing declarations), and (2) is still a
strict improvement over the current situation, where we will eagerly
abort the compiler trying to load the extension in the first place.

rdar://problem/40956460
@jrose-apple
Copy link
Contributor Author

@jckarter and I tried to reason out those two conditions—that this shouldn't make anything worse, and will make something better—but if other people can poke holes in that I'd love to hear it.

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test source compatibility

@jrose-apple jrose-apple requested review from slavapestov and huonw June 25, 2018 23:23
@jrose-apple jrose-apple merged commit 7f33f47 into swiftlang:master Jun 26, 2018
@jrose-apple jrose-apple deleted the requisite-requirements branch June 26, 2018 02:17
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Jun 26, 2018
…wiftlang#17488)

If, for whatever reason, a type used in an extension's generic
requirements is missing, just drop the whole extension. This isn't
wonderful recovery, but in practice nothing should be able to use the
extension anyway, since the relevant type in question is missing.

...Okay, that's not quite true; there could, for example, be inlinable
code that references one of these methods. However, that (1) isn't
worse than the behavior for any other inlinable code (which doesn't
yet attempt to recover from missing declarations), and (2) is still a
strict improvement over the current situation, where we will eagerly
abort the compiler trying to load the extension in the first place.

rdar://problem/40956460
(cherry picked from commit 7f33f47)
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