-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Serialization: Also serialize the filename for internal storage decls with private accessors #23074
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
Serialization: Also serialize the filename for internal storage decls with private accessors #23074
Conversation
… with private accessors If a value decl is internal hasTestableOrPrivateImport will succeed (or fail) without looking at the filename. However this breaks when we query an internal storage decl with private formal access for a private setter: the query would fail because no filename was serialized for the decl (we only serialize filenames for private decls). So in the special case of a internal storage with private accessor also serialize the filename. rdar://48516545
@swift-ci Please test |
Build failed |
@swift-ci Please test |
Build failed |
Build failed |
Static analysis run from Xcode? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, except…
lib/Serialization/Serialization.cpp
Outdated
!value->getDeclContext()->isLocalContext() && | ||
(access <= swift::AccessLevel::FilePrivate || | ||
(storage && | ||
storage->getFormalAccess() == swift::AccessLevel::Internal && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't it be public
with a private
setter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. thanks!
I had mistakingly tested
public struct Foo {
private(set) var publicVarWithPrivateSetter : Int = 0
instead of
struct Foo {
public private(set) var publicVarWithPrivateSetter : Int = 0
@swift-ci Please test |
Build failed |
Build failed |
If a value decl is internal hasTestableOrPrivateImport will succeed (or
fail) without looking at the filename. However this breaks when we query
an internal storage decl with private formal access for a private
setter: the query would fail because no filename was serialized for the
decl (we only serialize filenames for private decls). So in the special
case of a internal storage with private accessor also serialize the
filename.
rdar://48516545