Repository navigation
fix(loops): a variable unset before a continue or break is possibly undefined after the loop - #14509
Conversation
…ndefined after the loop vimeo#14486 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Behaviour change
Unchanged: a variable unset and assigned again before the jump, a jump through a Verified: the 5 new invalid cases ( |
✅ Performance: unchanged · Types: unchanged
How to read this table
head 985aa73 · base b5ea40d (merge-base) · workflow run |
…s is possibly undefined after the loop vimeo#14486 The variable was made possibly undefined only when it was missing at every `break` (or `continue`); unset before one and set at another, it is in the merged state as possibly undefined, which was not applied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review finding of the triage report (head e3ec93e), confirmed and fixed in f0ed13b: with
|
# Conflicts: # tests/Loop/ForeachTest.php
# Conflicts: # tests/Loop/WhileTest.php
# Conflicts: # tests/Loop/ForTest.php # tests/Loop/WhileTest.php
|
Thanks @jirkace! |
A variable unset in a loop before a
continueor abreak, or unset conditionally in the body, isn't reported as possibly undefined after the loop.Before
After
Fixes #14486