-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Diagnosing a private setter being accessed from the inlinable function. #86076
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
base: main
Are you sure you want to change the base?
Conversation
|
@swift-ci please smoke test |
lib/Sema/ResilienceDiagnostics.cpp
Outdated
| if (accessor->getAccessorKind() == AccessorKind::Set && | ||
| accessor->getFormalAccess() == AccessLevel::Private) { | ||
| auto *storage = accessor->getStorage(); | ||
| if (storage->getAttrs().hasAttribute<UsableFromInlineAttr>()) { |
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.
What if the storage is public? We don't want to check for this attribute directly, instead check it using access scopes like we do for everything else.
1dca620 to
6a13458
Compare
|
@swift-ci please smoke test |
6a13458 to
4ec9a06
Compare
|
@swift-ci please smoke test |
4ec9a06 to
4af1a8b
Compare
4af1a8b to
38cbc7d
Compare
|
@swift-ci please smoke test |
1 similar comment
|
@swift-ci please smoke test |
|
@swift-ci please smoke test linux |
Swift compiler allowed accessing a private setter from an @inlinable function. This change detects and diagnose it with a corresponding error.
rdar://81879146