Skip to content

[Serialization] Recover in opaque type deserialization logic on XRef errors #62980

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 2 commits into from
Jan 13, 2023

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Jan 11, 2023

If the underlying type of an opaque return type references an implementation-only imported type, drop the underlying type information and keep going.

The failure is tested by the new implementation-only-opaque-type.swift test. I've also seen it in WIP deserialization safety feature where there are crashes or dropped decls in more existing tests:

IRGen/mangle-opaque-return-type.swift
IRGen/opaque_result_type_private_underlying.swift

rdar://103238451

@xymus xymus requested review from slavapestov and bnbarham January 11, 2023 22:36
@xymus
Copy link
Contributor Author

xymus commented Jan 11, 2023

@slavapestov Are there side-effects from dropping the underlying type of an opaque return type that I should test for?

If the underlying type of an opaque type references an
implementation-only imported type, drop the underlying type information.

Without this fix, once we enable deserialization safety, we see crashes
or dropped decls in more existing tests:

IRGen/mangle-opaque-return-type.swift
IRGen/opaque_result_type_private_underlying.swift
Serialization/Recovery/implementation-only-opaque-type.swift

rdar://103238451
@xymus xymus force-pushed the recover-opaque-types branch from 263d154 to 71f116c Compare January 12, 2023 17:11
@xymus
Copy link
Contributor Author

xymus commented Jan 12, 2023

@swift-ci Please smoke test

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