-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow explicit nil to be serialized by enums
This commit uses an `UNSET` constant as the default `serialized_val` on `T::Enum`. This allows the runtime to understand the difference between an explicit `nil` and an unset default when serializing enum values. Sorbet already understands statically that a serialized value can be of type `NilClass`, but the runtime was serializing as a string representation based on the constant name instead.
- Loading branch information
1 parent
718bc64
commit bc24d25
Showing
2 changed files
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters