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-3480] Error when importing iOS 8+ framework target that contains an iOS 9+ compatible type #46068

Closed
swift-ci opened this issue Dec 23, 2016 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself PrintAsClang Area → compiler: The PrintAsClang library

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-3480
Radar None
Original Reporter robdashnash (JIRA User)
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

Xcode Version 8.2.1 (8C1002) running on Mac OS Sierra Version 10.12.1 (16B2555)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, PrintAsObjC
Assignee @belkadan
Priority Medium

md5: 068dceaa5b173df211a6063019b7ecb9

Issue Description:

I have a framework target set to deploy on iOS 8. The code is attached as a zip archive.

An iOS 9+ type has been extended in said framework and looks like so:

@available(iOS 9.0, *)
extension NSLayoutAnchor {

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

}

When attempting to import this framework into an iOS 8+ App target, I get a problem.

:0: error: could not build Objective-C module '' expected a type.

The error is referring to the AnchorType, which appears to be wrapped in /* */ in the framework's generated header file.

@interface NSLayoutAnchor (SWIFT_EXTENSION(<module name>))
- (void)constrainEqual:(NSLayoutAnchor</* AnchorType */> * _Nonnull)anchor constant:(CGFloat)constant;
@end
@belkadan
Copy link
Contributor

belkadan commented Jan 6, 2017

I think this is about not being able to represent the generic parameter rather than the 8 vs. 9. @DougGregor, @jckarter, what do you think PrintAsObjC should be doing in this case?

@swift-ci
Copy link
Contributor Author

Comment by Rob Nash (JIRA)

Bump +

@belkadan
Copy link
Contributor

#7818

@belkadan
Copy link
Contributor

Fixed in master (but unfortunately not in Swift 3.1, since it's not a regression).

@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 itself PrintAsClang Area → compiler: The PrintAsClang library
Projects
None yet
Development

No branches or pull requests

2 participants