-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Serialization: Fix deserializing opaque types details for computed properties and subscripts #69546
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
Conversation
@swift-ci Please smoke test |
1329055
to
7cb9e5a
Compare
e727b65
to
cda347e
Compare
@swift-ci Please smoke test |
I significantly changed this PR to move the core logic from the reader side to the writer side. The accessors were not always available at deserialization, which lead to unexpected results. Now we determine if the underlying type should be exported at serialization, write it as a bit in the swiftmodule, and use it to decide if we should read the underlying information at deserialization. |
…s and subscripts A client shouldn't know about the underlying type of an opaque type unless it can see the body of the naming decl. Attempting to read it can lead to accessing a hidden dependency and a compiler crash. This was protected by a check specific to function decls but var decls and subscripts were not handled. To support them we have to move this logic to the writer side where we have access to the full AbstractStorageDecl and write in the swifmodule whether the underlying type should be visible outside of the module. rdar://117607906
cda347e
to
f2d1627
Compare
Extracted the test to two new files where one is restricted to macOS hosts. @swift-ci Please smoke test |
A client shouldn't know about the underlying type of an opaque type unless it can see the body of the naming decl. Attempting to read it can lead to accessing a hidden dependency and a compiler crash.
This was protected by a check specific to function decls but var decls and subscripts were not handled. To support them we have to move this logic to the writer side where we have access to the full AbstractStorageDecl and write in the swifmodule whether the underlying type should be visible outside of the module.
rdar://117607906