-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Add ability to specify protocol conformance on C++ side. #62330
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
Conversation
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really awesome, thank you @zoecarver :)
We should error out if the protocol lookup fails to catch typos . |
we should also error out on ambiguous lookups, no? |
@swift-ci please test |
lib/AST/ProtocolConformance.cpp
Outdated
protocols.insert(proto); | ||
} | ||
auto addSynthesized = [&](ProtocolDecl *proto) { | ||
llvm::dbgs() << "S\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug output, pls rm -rf.
df4745b
to
665d3e1
Compare
@swift-ci please test |
1 similar comment
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great improvement but I'm a bit worried that importing a C++ module can now trigger loading of an unrelated Swift module, which might run into cyclic dependencies.
Could you please add a test that has something like this:
- a C++ module
A
that contains a decl withconforms_to:X
attr - a Swift module
B
that importsA
- a Swift module
C
that importsB
and containsprotocol X
fd025ab
to
1a0e1ad
Compare
@swift-ci please test |
Yeah this is a good point. Regardless, it is not ideal that we have to load all the modules and potentially have ambiguities. What if we just required people to specify the module in the attribute string? |
I'd be more than happy with that; requiring to be precise here sounds good tbh. |
I will address the review comments post-commit. I think we should require the user to specify both the module and the protocol. |
No description provided.