Skip to content

[Clang importer] Restore historical definition of "Boolean for Objective-C" #64330

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
Mar 13, 2023

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Mar 13, 2023

The isBoolType operation within the Clang importer has a historical definition that excludes the C++ bool and its use in C as an extension. Retain that definition, and check for the actual bool when importing C++ conversion functions into Swift.

Fixes two regressions in the Clang importer:

  1. We started to import bool-typed Objective-C properties with their getter names.
  2. We started importing bool-typed Objective-C methods with an NSError** parameter as throws.

Both of these changes could be considered improvements, but they cannot be made without breaking source compatibility, so roll those changes back to maintain source compatibility.

We should have a separate discussion about enabling this behavior for Swift >= 6.

Fixes rdar://106665264

…ive-C"

The `isBoolType` operation within the Clang importer has a historical
definition that excludes the C++ `bool` and its use in C as an
extension. Retain that definition, and check for the actual `bool`
when importing C++ conversion functions into Swift.

Fixes two regressions in the Clang importer:

1. We started to import `bool`-typed Objective-C properties with their
getter names.
2. We started importing `bool`-typed Objective-C methods with an
NSError** parameter as `throws`.

Both of these changes could be considered improvements, but they
cannot be made without breaking source compatibility, so roll those
changes back to maintain source compatibility.

We should have a separate discussion about enabling this behavior for
Swift >= 6.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 2abd742 into swiftlang:main Mar 13, 2023
@DougGregor DougGregor deleted the historical-objc-bool branch March 14, 2023 05:48
@egorzhdan
Copy link
Contributor

Oh I didn't realize the impact on Objective-C when I made the original change, thanks @DougGregor for fixing this!

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.

3 participants