Skip to content

Conversation

@kavon
Copy link
Member

@kavon kavon commented Nov 11, 2025

irgen::addGenericRequirements will later filter out Copyable and Escapable requirements, so this field's count isn't accurate if it's using the pre-filtered number.

This should in theory only affect the metadata emission for keypaths, specifically, the caller IRGenModule::getAddrOfKeyPathPattern.

NOTE: This is an ABI change, as any keypath formed using a generic type that conforms to a noncopyable or nonescapable protocol will have its count of conformance requirements change to a corrected, smaller number.


// Generic requirements
irgen::addGenericRequirements(*this, fields, signature);
irgen::addGenericRequirements(*this, fields, signature, reqs, inverses);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do the other callers of the three-argument overload need to be audited to see if they need the same fix? Maybe it should be removed?

Copy link
Member

Choose a reason for hiding this comment

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

Removing it is probably a good idea; it's too easy to misuse the 3-argument version.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I can do that.

Copy link
Member Author

@kavon kavon Dec 1, 2025

Choose a reason for hiding this comment

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

I think it's worth doing the auditing in a follow-up PR. I didn't see any other obvious mistakes in other callers of the 3 argument version.

@kavon
Copy link
Member Author

kavon commented Nov 12, 2025

@swift-ci smoke test macOS

1 similar comment
@kavon
Copy link
Member Author

kavon commented Nov 13, 2025

@swift-ci smoke test macOS

@airspeedswift
Copy link
Member

@swift-ci test

`irgen::addGenericRequirements` will later filter out Copyable
and Escapable requirements, so this field's count isn't accurate
if it's using the pre-filtered number.

This should in theory only affect the metadata emission for keypaths,
specifically, the caller `IRGenModule::getAddrOfKeyPathPattern`.
@kavon kavon force-pushed the keypath-metadata-fix branch from fb06e8b to 38af19b Compare December 1, 2025 23:07
@kavon kavon marked this pull request as ready for review December 1, 2025 23:08
@kavon kavon requested a review from rjmccall as a code owner December 1, 2025 23:08
@kavon
Copy link
Member Author

kavon commented Dec 1, 2025

@swift-ci test

@kavon kavon enabled auto-merge December 1, 2025 23:44
@kavon kavon merged commit 1f69673 into swiftlang:main Dec 2, 2025
4 of 5 checks passed
@kavon kavon deleted the keypath-metadata-fix branch December 2, 2025 17:31
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.

4 participants