Skip to content

Use the API Name of Enum Parameters to Determine Coding Keys #40596

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
Dec 17, 2021

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Dec 16, 2021

Covers a missing case in codable synthesis for enums with argument
payloads that have internal and external labels. When the name of the
var decl is used, the internal name of the parameter becomes the key
instead of the API name. In this case, this causes an invalid reference
to an enum case with the internal name as an argument to be synthesized
in the derived Decodable conformance which (hopefully) crashes
downstream.

rdar://86339848

Covers a missing case in codable synthesis for enums with argument
payloads that have internal and external labels. When the name of the
var decl is used, the internal name of the parameter becomes the key
instead of the API name. In this case, this causes an invalid reference
to an enum case with the internal name as an argument to be synthesized
in the derived Decodable conformance which (hopefully) crashes
downstream.

rdar://86339848
@CodaFi
Copy link
Contributor Author

CodaFi commented Dec 16, 2021

@swift-ci smoke test and merge

Copy link
Contributor

@drexin drexin left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@swift-ci swift-ci merged commit 2fc0e35 into swiftlang:main Dec 17, 2021
@CodaFi CodaFi deleted the label-and-slander branch January 4, 2022 23:17
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.

3 participants