The error slot of a value-carrying failable can no longer be silently dropped on a bare destructure. In lowerDestructureDecl, when the RHS is failable (errorChannelOf(ty) != null), the error slot (always the last tuple field) must be bound to a non-`_` name. Reject when it is omitted entirely (fewer names than slots — e.g. `a, c := inc(5)` for `inc: -> (s32,s32,!E)`) or bound to `_` (`v, _ := parse(5)`). The `try` / `catch` / `or value` consumer forms all strip the error channel (their result type is non-failable), so the check never fires on them — only a bare failable destructure is rejected. Value-slot `_` discards stay legal (`a, _, ae := pair()` binds the error). This is the discard-rejection slice of E1.8; the path-sensitive flow-check (value live only where err==null is provable) is a separate follow-up. examples/236-failable-discard-reject.sx covers both rejected shapes (exit 1). Gates: zig build, zig build test, 274/274 examples.
2 lines
2 B
Plaintext
2 lines
2 B
Plaintext
1
|