-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Cross-Import Overlays #29582
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
Cross-Import Overlays #29582
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b3355ae
to
1c53d17
Compare
Feature-complete. To do:
|
c3c5bdd
to
a0edb7a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
c9875b9
to
bdd84f5
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Courtesy of Varun.
It’s not often that a PointerUnion makes the code *more* safe and clear, so let’s take it.
2291bff
to
9a09eb7
Compare
@swift-ci please test |
Build failed |
Build failed |
@varungandhi-apple I'm going to merge this, but feel free to post additional comments on the last round of changes. |
LGTM 😄 |
Just a note: a couple of tests seem broken on Windows (started in https://ci-external.swift.org/job/oss-swift-windows-x86_64/2907/ and https://ci-external.swift.org/job/oss-swift-windows-x86_64-vs2019/103/). One of the failing tests seems to be simple error message differences in Windows. The other seems to be some path comparison that doesn't normalize paths. /cc @compnerd |
We'll look into this. |
I have a PR up at #29962 to unblock windows testing. |
Related PR with the diagnostic fix: [just to get the GitHub cross-linking to show up] #29965 |
This PR adds cross-import overlays to Swift. Cross-import overlays allow a module to declare that, when it is imported in the same file as a second module, one or more additional modules should be imported as well. It can be used, for instance, to automatically import test helpers when your module is imported along with
XCTest
.This implementation intentionally deviates from the pitch thread in certain ways:
.swiftoverlay
..../Foo.swiftmodule/Overlays
, we store them in.../Foo.swiftcrossimport
. This allows "thin" (i.e. non-platform-specific) Swift modules to declare cross-import overlays.Foo.swiftcrossimport
directory next to themodule.modulemap
file that defines them.Other differences are either unintentional, incomplete, or undecided.
Fixes rdar://problem/59444602.