Skip to content

[5.5][Sema] Use decodeIfPresent for optional enum params in Codable synthesis #38037

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
Jun 24, 2021

Conversation

drexin
Copy link
Contributor

@drexin drexin commented Jun 22, 2021

  • Explanation: The code generation did not use encodeIfPresent for optional parameters, causing decoding to fail if the value was absent
  • Scope: Synthesis of Codable conformance for enums
  • Risk: Low
  • Testing: Added regression test
  • Issue: rdar://79584261

This code has been refactored on main and the bug is not present there, but it is less risky to do the simple fix here, instead of backporting the refactored code.

@drexin drexin requested a review from a team as a code owner June 22, 2021 23:08
@drexin drexin added the r5.5 label Jun 22, 2021
@drexin
Copy link
Contributor Author

drexin commented Jun 22, 2021

@swift-ci test

@grynspan
Copy link
Contributor

Thanks for the quick turnaround!

@drexin
Copy link
Contributor Author

drexin commented Jun 23, 2021

@swift-ci nominate

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 45dc6c9

@drexin
Copy link
Contributor Author

drexin commented Jun 23, 2021

@swift-ci test macos

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 45dc6c9

@drexin
Copy link
Contributor Author

drexin commented Jun 23, 2021

@swift-ci test macos

@drexin drexin merged commit 7475607 into swiftlang:release/5.5 Jun 24, 2021
@drexin drexin deleted the wip-fix-optional-enum-codable branch June 24, 2021 15:27
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.5 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.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants