importing iOS 8 framework that has some iOS 9+ compatible logic
<p>I have a framework target that is set to deploy on iOS 8. There is one extension in said framework, like so, which is wrapped in an iOS 9 check.</p>

<pre><code>@available(iOS 9.0, *)
extension NSLayoutAnchor {

    open func constrainEqual(_ anchor: NSLayoutAnchor, constant: CGFloat = 0) {
        constraint(equalTo: anchor, constant: constant).isActive = true
    }

}
</code></pre>

<p>When I import this framework into an App target that has Swift code only and is set to deploy to iOS 8, I get the following error from the imported swift's framework objective-c header file.</p>

<p>:0: error: could not build Objective-C module '' expected a type. </p>

<p>The swift framework's objective-c header file has an error at 'AchorType' in the following line, which is weirdly encapsulated in /* */ for some reason:</p>

<pre><code>@interface NSLayoutAnchor (SWIFT_EXTENSION(&lt;module name&gt;))
- (void)constrainEqual:(NSLayoutAnchor&lt;/* AnchorType */&gt; * _Nonnull)anchor constant:(CGFloat)constant;
@end
</code></pre>

<p>It seems like a bug in swift where the automatically generated objective-c header file (for the swift framework) gets it wrong, for this particular type. The problem is solved if I remove the extension.</p>

<p>Am I wrapping it incorrectly ?</p>