Commit Graph

1 Commits

Author SHA1 Message Date
agra
4de565b7da docs: forbid silent unimplemented arms in REJECTED PATTERNS
Sibling to the silent-fallback-defaults rule. Catch-all `else`
branches that pass a value through unchanged, write a default width,
or swallow errors into a zero-init are the same class of bug — a
case the implementer didn't think of corrupts data silently.

Both bites this session:

- `storeAtRawPtr` writing 8 bytes regardless of IR type (fixed by
  threading val_ty through inst.Store).
- `.deref` else-arm returning val unchanged (now errors loudly for
  raw pointers).
- comptime init catch swallowing the error into `.void_val`.

Preferred order: implement the arm in the same step. If plumbing is
out of scope, bail loudly with `bailDetail(comptime msg)` and leave a
one-line comment about what's needed. Width/type/layout info that's
ambiguous from the Value tag belongs in the IR op struct, not in a
"this case is usually 8 bytes" shortcut.
2026-05-25 11:45:45 +03:00