Enabling Extension-safe API check changes generated ObjC-Header

Number:rdar://34790796 Date Originated:3 Oct 2017
Status:Open Resolved:
Product:Xcode Product Version:9.0 (9A235)
Classification:Other Bug Reproducible:Always

For Swift-based frameworks/modules, Xcode generates an Objective-C header named `Module-Swift.h`. Ordinarily this only includes public classes. But if you turn on the "Allow app extension API only" setting, then also internal classes are included.

Steps to Reproduce:

1. Build the Module scheme of the provided sample app with Xcode 9
2. Inspect the Module-Swift.h contained in the produced Module.framework
3. You will see only the public classes `CustomView` and `AncestorView` 
4. Now turn on "Allow app extension API only" in the Module target build settings and build again
5. Inspect the same header as in step 1.

Expected Results:

- The generated Objective-C header should be identical regardless of the state of this setting

Actual Results:

- With the setting off, only public classes are showing
- With the setting on, you also see the internal class `SwiftViewController`


Xcode 9.0 (9A235)


iMac or MacBook, with Xcode 9 and macOS 10.13

The mentioned sample is on my Radar Samples GitHub repo (https://github.com/Cocoanetics/RadarSamples), titled InterfaceTest.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!