Skip to content

[ConstraintSystem] Adjust isArgumentOfImportedDecl to handle synthesized declarations #83620

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Aug 8, 2025

If the declaration was synthesized for an imported type,
let's consider it imported as well even though there is
no direct clang declaration backing it.

This allows us to support features like pointer conversions
that are gated on the declarations being imported from C.

Resolves: #83221
Resolves: rdar://156356307

xedin added 2 commits August 8, 2025 14:06
…sized declarations

If the declaration was synthesized for an imported type,
let's consider it imported as well even though there is
no direct clang declaration backing it.

This allows us to support features like pointer conversions
that are gated on the declarations being imported from C.

Resolves: swiftlang#83221
Resolves: rdar://156356307
@xedin
Copy link
Contributor Author

xedin commented Aug 8, 2025

@swift-ci please test

Copy link
Contributor

@Xazax-hun Xazax-hun left a comment

Choose a reason for hiding this comment

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

The change looks good to me but I am a bit unsure why we want to allow these conversions implicitly. The equivalent of a raw pointer in C++ would probably be something like void* and even C++ requires explicit casts from void to a different type.

What is the motivation here to be less safe than C++ in interop?

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.

Incorrect/Invalid diagnostic: initializer was not imported from C header
2 participants