You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b4bf2bb
Browse filesBrowse the repository at this point in the historyBrowse files
Narrowing after an early exit; a narrowed field is read from the field (#383)
`if (x === null) return;` now narrows x for the rest of the block, as an else
branch does: an if without else whose body always returns, throws, breaks or
continues applies its else narrowing after the if. Each block opens its own
narrowing scope, so a narrowing made in it ends with it.
A narrowed field (`this.head` after `this.head !== null`) was mapped to the
value the narrowing cast, and every later read reused that value. An
assignment to the field then failed ("saving to constant object"), a read
after it returned the old value, and a value used outside its region was the
use-after-free #377 fixed for else. safeTypesMap now keeps only the narrowed
type: a read loads the field again and casts it the way addSafeCastStatement
does (castToNarrowedType), and an assignment writes the field itself.
Found in the BrowserLib sources attached to #231 (Event.ts `remove`).
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments