ObjC-Swift interface header does not expose imports to ObjC++

Importing the automatically generated -Swift.h into an ObjC++ file (where modules are not enabled) can lead to errors because imports made in Swift are only exposed as @import statements.

Example:
The following code is part of a framework TestFramework and has a class that uses a type from AppKit.

import AppKit

@objc public class TestClass: NSObject {
	@objc public var state: NSControl.StateValue = .off
}

The interface header re-exports the AppKit import like this, but there is no else case for !__has_feature(objc_modules):

#if defined(__OBJC__)
#if __has_feature(objc_modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import AppKit;
@import ObjectiveC;
#endif

#endif

…

SWIFT_CLASS("_TtC13TestFramework9TestClass")
@interface TestClass : NSObject
@property (nonatomic) NSControlStateValue state;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

Importing <TestFramework/TestFramework-Swift.h> in an ObjC++ file will fail, since it can't resolve NSControlStateValue.
Now it is possible to fix it by adding #import <AppKit/AppKit.h> before #import <TestFramework/TestFramework-Swift.h> but that is very fragile and inconvenient.

I had a look into the swift compiler sources and also played around with the -emit-clang-header-nonmodular-includes flag, but that did not help.

Is this expected behavior or is there a way to configure the creation of the interface header to also generate #import statements?

Any help would be greatly appreciated!
Markus

I did find an acceptable-ish workaround for this and just wanted to share it here to maybe help someone else in a similar situation.

I noticed that in one of my generated interface headers the compiler added an #import for the frameworks umbrella header. It does this if a type declared in the umbrella header is used in Swift code that is also declared as @objc public. This then allowed be to manually add the missing #import statements in the umbrella header to fix the compile breaks.

Example:

// Umbrella header
typedef NSString *NonModularWorkaroundType NS_TYPED_EXTENSIBLE_ENUM;

#import <AppKit/AppKit.h>
…
// NonModularWorkaround.swift
@objc public class NonModularWorkaround: NSObject {
	@objc public let workaround = NonModularWorkaroundType("")
}

I used a NS_TYPED_EXTENSIBLE_ENUM typedef, but this will probably also work with other types as well.