Skip to content

[cxx-interop] Avoid generating ambiguous wrapper functions #79012

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
Jan 29, 2025

Conversation

Xazax-hun
Copy link
Contributor

When we generate a safe wrapper that only differs in the return type we might introduce ambiguities as some callers might not have enough information to disambiguate between the overloads. This PR makes sure the newly generated declarations are marked as @_disfavoredOverload so the compiler can keep calling the old functions without a source break when the feature is turned on.

rdar://139074571

@Xazax-hun Xazax-hun added the c++ interop Feature: Interoperability with C++ label Jan 29, 2025
@Xazax-hun Xazax-hun requested a review from hnrklssn January 29, 2025 13:34
When we generate a safe wrapper that only differs in the return type we
might introduce ambiguities as some callers might not have enough
information to disambiguate between the overloads. This PR makes sure
the newly generated declarations are marked as @_disfavoredOverload so
the compiler can keep calling the old functions without a source break
when the feature is turned on.

rdar://139074571
@Xazax-hun Xazax-hun force-pushed the gaborh/disfavoredOverload branch from 0ac2a40 to a57aff0 Compare January 29, 2025 15:19
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@Xazax-hun Xazax-hun enabled auto-merge January 29, 2025 19:21
@Xazax-hun Xazax-hun merged commit 7eada7d into main Jan 29, 2025
3 checks passed
@Xazax-hun Xazax-hun deleted the gaborh/disfavoredOverload branch January 29, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants