Change nonsense return types to Nil: JSON and YAML #10622
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Strictly speaking, this is a backwards-incompatible change, but it should not affect any reasonable code. Attentive review is advised.
First I ran a tool to automatically insert return type restrictions based on what methods actually return in real usages. Then I picked out returns that are obviously purely accidental (due to implicitly returning the last expression) and can never be useful. So I change them to always be Nil.
How to review this:
The 1st commit exists only to provide a more useful diff in the 2nd commit.
Please look only at the 2nd commit (and not the overall diff) to see how this pull request changes actual return types that occur, into Nil.