Skip to content
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

[SR-2772] Objective-C compatibility header exposes private extensions outside its module. #45376

Closed
swift-ci opened this issue Sep 27, 2016 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers PrintAsClang Area → compiler: The PrintAsClang library

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-2772
Radar rdar://problem/26322633
Original Reporter calebd (JIRA User)
Type Bug
Status Closed
Resolution Done
Environment

Swift 2.3 and Swift 3.0

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, PrintAsObjC, StarterBug
Assignee calebd (JIRA)
Priority Medium

md5: 776f040bf9d73bba3a876663e807e071

relates to:

  • SR-7051 Compiler fails with "Module not found" error

Issue Description:

A Swift module that defines private or internal extensions on a public Objective-C type will export that extension publicly through its `-Swift` compatibility header.

FooObjectExtensions.swift:

import FooModule

extension FooObject {
    func doThing()
}

BarModule-Swift.h:

@import Foo;

@interface FooObject (SWIFT_EXTENSION(BarModule))
@end

This is problematic because private dependencies are exposed as `@import`s to the outside through the compatiblity header. The compatibility header generator should remove extensions that have empty bodies.

@belkadan
Copy link
Contributor

Just tagged this as a Starter Bug. This shouldn't be too hard to implement by piggy-backing on the existing logic for finding what needs to be forward-declared before emitting an extension/category.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Mar 7, 2017

Comment by Caleb Davenport (JIRA)

Fixed in #7926.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers PrintAsClang Area → compiler: The PrintAsClang library
Projects
None yet
Development

No branches or pull requests

2 participants