Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix returning [Type, false] from resolve_type
#4130 fixed returning `[Type, nil]` from a union's `resolve_type`, but it caused a regression for literal `false` values. `Schema#resolve_type` had a `if resolved_value` conditional would be false for `false` values causing it _always_ return a single value (the `resolve_type`). The runtime's `resolve_type` method would then _always_ return the tuple version (in non-lazy cases): `[type, value]`. However, since `Schema#resolve_type` was only returning a single value, the resolved value would be lost resulting in `[type, nil]` being passed on. The fix is to remove the `if resolved_value` conditional entirely and always return the two-value tuple ensuring the original resolved value is correctly passed along. Note: the runtime still has a branch to check if the `resolve_type` value is a tuple or not. The only case where this won't be true is for lazy resolved types.
- Loading branch information
1 parent
96ae99b
commit 7e077be
Showing
3 changed files
with
109 additions
and
34 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
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