-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[cxx-interop] Make imported enum members inherit the access of their parent #84522
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
…parent This patch relaxes the access check for members of imported inherited nested enums. Without it, those members become impossible to inherit, which largely defeats the purpose of importing them in the first place. rdar://160803362
@swift-ci please test |
@swift-ci please test |
|
||
AccessInversionTestSuite.test("usePrivateEnum") { | ||
let e = Leaky.AliasToPrivateEnum(rawValue: 0)! | ||
let e = Leaky.AliasToPrivateEnum(rawValue: 0) |
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.
I'm not actually sure why this changed/had to be written like this before. But this seems like the right behavior to me, since the initializer does not return an optional.
test/Interop/Cxx/class/access/non-public-nested-enum-typecheck.swift
Outdated
Show resolved
Hide resolved
test/Interop/Cxx/class/access/access-inversion-typechecker.swift
Outdated
Show resolved
Hide resolved
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.
LGTM, this seems like a path of the least resistance
@swift-ci please test |
This patch relaxes the access check for members of imported inherited nested enums. Without it, those members become impossible to inherit, which largely defeats the purpose of importing them in the first place.
rdar://160803362