Uploaded image for project: 'Swift'
  1. Swift
  2. SR-5221

Second generated header for the 'internal' parts of framework targets



    • Type: New Feature
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Labels:


      To improve mixed Swift/Objective-C frameworks, there should be a way to generate a header for the internal parts of a Swift framework that are also @objc. This would act like a "project" header in Xcode that does not get copied into the build products.

      This hasn't been implemented in the past mainly because it requires splitting the internal members of a public class out to a category, but support for "delaying" members got added last year in PR 4155 anyway. This would just be another form of that.

      Implementing this would involve something like the following:

      • A new -emit-objc-internal-header-path command-line option.
      • Rather than skipping over internal declarations in PrintAsObjC, adding them to a list much like the delayedMembers list today.
      • Print all those declarations to a separate buffer, with a separate imports list.
      • Write all that to a new header that imports <MyModule/MyModule-Swift.h>.

      There are then Xcode-side changes that need to happen to make this a fully-supported feature, but this would be good enough to use it with a toolchain!




            • Assignee:
              jrose Jordan Rose
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created: