Skip to content

[5.3][stdlib] Add _forEachField(of:options:body:) function (#32873) #32965

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

lorentey
Copy link
Member

This function walks all the fields of a struct, class, or tuple, and calls
body with the name, offset, and type of each field. body can perform
any required work or validation, returning true to continue walking fields
or false to stop immediately.

(cherry picked from #32873)

This function walks all the fields of a struct, class, or tuple, and calls
`body` with the name, offset, and type of each field. `body` can perform
any required work or validation, returning `true` to continue walking fields
or `false` to stop immediately.

(cherry picked from commit 3af1deb)
@lorentey lorentey added the r5.3 label Jul 17, 2020
@lorentey lorentey requested a review from a team as a code owner July 17, 2020 23:36
@lorentey
Copy link
Member Author

@swift-ci test

Ensure that the string that is formed from the `asprintf` call is
null-terminated.  The `_vsnprintf` call will not null-terminate the
string if the length is not sufficient.

(cherry picked from commit 37ee73c)
@lorentey
Copy link
Member Author

lorentey commented Jul 18, 2020

The Windows failure is due to #32898; I've cherry picked that fix here, too.

@lorentey
Copy link
Member Author

@swift-ci test

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

@lorentey
Copy link
Member Author

@swift-ci test linux platform

@lorentey lorentey merged commit 62e6834 into swiftlang:release/5.3 Jul 27, 2020
@lorentey lorentey deleted the the-fields-are-alive-with-the-sound-of-reflection branch July 27, 2020 21:31
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants