Skip to content

Skip NullToStrictString arg already cast to target type - #8688

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-null-to-strict-string-skip-already-cast
Oct 17, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-null-to-strict-string-skip-already-cast

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Make the NullToStrictStringIntConverter idempotent: skip a value that is already a cast or literal of the target type (or a ternary whose both branches are), so re-processing does not nest a redundant (string)/(int) cast.

The check is structural, so it also holds when the resolved type is stale on a re-printed node - the usual type-based skip relies on a fresh type and would miss it there.

Guard against nesting a redundant cast when the converter re-processes a value already cast or literal of the target type (or a ternary whose branches are). Structural check, immune to stale resolved types on re-printed nodes.
@TomasVotruba
TomasVotruba merged commit 9c65361 into main Oct 17, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-null-to-strict-string-skip-already-cast branch October 17, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant