Skip to content

Sema: Allow @objc enums without -enable-objc-interop or importing Foundation #37661

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 1 commit into from
May 29, 2021

Conversation

slavapestov
Copy link
Contributor

We used to allow @objc enums on Linux, where Objective-C interop is disabled,
because the check first looked for an import of the Foundation module
(which could be the non-Objective-C corelibs-foundation) before checking
if Objective-C interop was enabled.

Since @objc enums don't actually depend on Foundation or Objective-C and
only have a different layout in IRGen, let's bring back and formalize the
old behavior.

Fixes https://bugs.swift.org/browse/SR-14548 / rdar://problem/77325078.

@slavapestov slavapestov requested a review from jckarter May 26, 2021 22:44
@slavapestov slavapestov force-pushed the objc-enum-on-linux branch from 69af48e to 562abde Compare May 27, 2021 01:57
…ndation

We used to allow @objc enums on Linux, where Objective-C interop is disabled,
because the check first looked for an import of the Foundation module
(which could be the non-Objective-C corelibs-foundation) before checking
if Objective-C interop was enabled.

Since @objc enums don't actually depend on Foundation or Objective-C and
only have a different layout in IRGen, let's bring back and formalize the
old behavior.

Fixes https://bugs.swift.org/browse/SR-14548 / rdar://problem/77325078.
@slavapestov slavapestov force-pushed the objc-enum-on-linux branch from 562abde to 30f038a Compare May 27, 2021 01:59
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@slavapestov slavapestov merged commit cb9db86 into swiftlang:main May 29, 2021
@varungandhi-apple
Copy link
Contributor

Cherry-picked to 5.5 here: #37664

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.

2 participants