fix!: Tighten and correct typings on ASTNode#8835
Merged
gonfunko merged 4 commits intoRaspberryPiFoundation:rc/v12.0.0from Apr 1, 2025
Merged
fix!: Tighten and correct typings on ASTNode#8835gonfunko merged 4 commits intoRaspberryPiFoundation:rc/v12.0.0from
gonfunko merged 4 commits intoRaspberryPiFoundation:rc/v12.0.0from
Conversation
Collaborator
rachel-fenichel
left a comment
There was a problem hiding this comment.
One more piece of cleanup, plus whatever is going on with the conventional commit labeler, and then good to go.
Contributor
Author
|
The commit labeler is just busted here because this is targeting v12 and the action fix isn't there yet. I manually assigned the appropriate labels. |
rachel-fenichel
approved these changes
Apr 1, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The basics
The details
Resolves
Fixes #8827
Proposed Changes
This PR updates most of the static
ASTNode.create*Node()methods to not check for null arguments (which their method signature prohibits) and not (claim to) return null when that only happened in the case of an invalid null argument. I also cleaned up several unsafe casts and non-null assertions and corrected some other typings.Breaking Changes
ASTNode.getWsCoordinate()now allows for null return types, which were always possible but not part of the return type beforecreateWorkspaceNode()no longer allows null workspace or coordinate arguments; it would have just returned null had either of those been provided, so callers check for that and do whatever they would have done had the return value been null.