Skip to content

[ClangImporter] Resolve forward declarations before importing names #7555

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

Merged
merged 1 commit into from
Feb 20, 2017

Conversation

jrose-apple
Copy link
Contributor

@jrose-apple jrose-apple commented Feb 17, 2017

This allows a previously-working case of Objective-C forward-declaring a type in a different Swift module to continue working, as long as the Swift context being compiled manages to import the other module properly (including its generated header). This isn't really our recommended pattern—that would be to @import the module in the bridging header and forego the forward declaration—but it doesn't cost much to keep it working. It's also a place where textual and precompiled bridging headers behaved differently, because precompiled ones are processed much earlier.

SR-3798

This allows a previously-working case of Objective-C forward-declaring
a type in a /different/ Swift module to continue working, as long as
the Swift context being compiled manages to import the other module
properly (including its generated header). This isn't really our
recommended pattern---that would be to @import the module in the
bridging header and forego the forward declaration---but it doesn't
cost much to keep it working. It's also a place where textual and
precompiled bridging headers behaved differently, because precompiled
ones are processed much earlier.

https://bugs.swift.org/browse/SR-3798
@jrose-apple jrose-apple requested a review from milseman February 17, 2017 04:09
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@milseman: Same question as before: is this safe for 3.1? (And is it a good patch in general?)

@ematejska: After all the effort I put in to convince everyone that this was not worth doing, it turned out to be easier to implement than to diagnose. But I can look for a diagnostic if we think this is too risky for 3.1.

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - f562aeb
Test requested by - @jrose-apple

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test macOS

Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jrose-apple jrose-apple merged commit e6a85f6 into swiftlang:master Feb 20, 2017
@jrose-apple jrose-apple deleted the a-rose-by-any-other-name branch February 20, 2017 21:24
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Feb 20, 2017
…wiftlang#7555)

This allows a previously-working case of Objective-C forward-declaring
a type in a /different/ Swift module to continue working, as long as
the Swift context being compiled manages to import the other module
properly (including its generated header). This isn't really our
recommended pattern---that would be to @import the module in the
bridging header and forego the forward declaration---but it doesn't
cost much to keep it working. It's also a place where textual and
precompiled bridging headers behaved differently, because precompiled
ones are processed much earlier.

https://bugs.swift.org/browse/SR-3798
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants