/** * Tripwire for the rule `collectChecks` must uphold. * * A pattern's job is to answer "does this value match". So the boolean * condition it lowers to has to be a TOTAL function of the value: safe to * evaluate on anything, and true only for values the pattern matches. Most * cases get that for free — `resultPattern` asks via `isSuccess(v)`, * `typePattern` via `__coarseTypeTest(v, kind)`, a literal via `v == lit`, and * all three are total on any input. Raw member access is the one non-total * operation available, and it is exactly what `objectPattern` and * `arrayPattern` use. * * The rule that makes them total: a case must assert the shape it is about to * destructure BEFORE destructuring it, and `patternToCondition` joins checks * with `&&` in order, so an earlier conjunct short-circuits a later read. * * Stated as an invariant this file can check: * * In a lowered pattern condition, every member access is preceded in the * `&&` chain by a shape check on each of its prefixes. * * A new pattern kind that reads a field without guarding it fails here rather * than waiting for someone to hit the crash. Patterns come from the corpus — * real ones the compiler already handles — so nothing is hand-enumerated * except the kind list, whose exhaustiveness the type system checks below. */ export {};