Skip to content

fix: variable assignments in if-branches no longer leak into elseif#222

Merged
calebdw merged 1 commit into
mainfrom
calebdw/push-sqrnyzopyyqo
Jul 10, 2026
Merged

fix: variable assignments in if-branches no longer leak into elseif#222
calebdw merged 1 commit into
mainfrom
calebdw/push-sqrnyzopyyqo

Conversation

@calebdw

@calebdw calebdw commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

The diagnostic scope cache already correctly records a clean scope snapshot at each elseif condition boundary (forward_walk.rs:5628-5633), preventing assignments from preceding if/elseif bodies from affecting type resolution in elseif conditions and bodies.

Add regression tests to prevent future regressions:

Fixes #167, #168.

The diagnostic scope cache already correctly records a clean scope
snapshot at each elseif condition boundary (forward_walk.rs:5628-5633),
preventing assignments from preceding if/elseif bodies from affecting
type resolution in elseif conditions and bodies.

Add regression tests to prevent future regressions:
- #167: $value = true in if-branch must not make elseif see bool
- #168: instanceof narrowing must not leak into elseif body

Fixes #167, #168.
@calebdw calebdw force-pushed the calebdw/push-sqrnyzopyyqo branch from 5804c1e to d854e82 Compare July 10, 2026 17:10
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 42.85714% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/completion/variable/forward_walk.rs 42.85% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

@calebdw calebdw merged commit 147a46c into main Jul 10, 2026
6 of 7 checks passed
@calebdw calebdw deleted the calebdw/push-sqrnyzopyyqo branch July 10, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False type_mismatch_argument after assignment in previous if branch

2 participants