Files
scriptc/tests
Malte UblandClaude Opus 5.5 bed8c9dd42 Extend asserted probes to the bracket spelling and union arms
`(x as T)["m"]` — the element-access spelling of a member probe — was not
recognized as a probe, so it went through the assertion's checked
extraction and trapped exactly like the property spelling did before
#2443. Recognize a literal-key element access as the same probe, and
answer it per arm there too.

`"m" in (x as T)` is likewise a probe of the asserted value, not a use of
the assertion: accept a union whose arms are all records or units when the
per-arm `in` answers every arm, so the optional-arm shape compiles instead
of refusing with SC1090.

A real use of the asserted member keeps the checked extraction and still
throws on a lying assertion.

tests/corpus/8512-asserted-probe-element-and-optional.ts pins the bracket
spelling, the member probe, and the throwing real use against Node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 09:37:10 -07:00
..
…