Diagnostics and Validation
The v0.33.x Result cycle was mostly about reconciling shipped behavior with docs, tests, K semantics, and old roadmap language. Most slices reused existing diagnostics instead of consuming new ARIA codes.
Common mistakes
Using ?? on a Result
int32:x = maybe_result() ?? 0i32; // rejected
Use ? for Result fallback:
int32:x = maybe_result() ? 0i32;
Using ?! without a fallback
The source form is infix and requires a fallback:
int32:x = maybe_result() ?! 77i32;
Safe navigation on a Result
?. is Optional/null safe navigation, not Result member navigation.
Handle the Result first.
catch on a non-Result
int32:x = 42i32 catch (err) { err }; // rejected
The receiver must be Result<T>.
Treating catch as C-style exceptions
This remains invalid:
try { work(); } catch (err) { 0i32; }
Nitpick's catch is contextual Result syntax only.
Decision map
| Decision | Locked behavior |
|---|---|
| RESULT-DEC-002 | ? is fallback unwrap. |
| RESULT-DEC-003 | Nested Result behavior is explicit, not hidden propagation. |
| RESULT-DEC-004 | ?? is Optional/pointer null coalescing. |
| RESULT-DEC-005 | Source ?! is emphatic fallback unwrap. |
| RESULT-DEC-006 | ?. returns Optional fields and rejects Result receivers. |
| RESULT-DEC-007 | ?| is defaults shorthand. |
| RESULT-DEC-008 | _? is exactly drop. |
| RESULT-DEC-009 | _! is exactly raw. |
| RESULT-DEC-010 | defaults has low-precedence left capture and primary fallback. |
| RESULT-DEC-011 | await work() ? fb parses as (await work()) ? fb. |
| RESULT-DEC-012 | Result<NIL> uses pass NIL / fail code. |
| RESULT-DEC-013 | catch is contextual and preserves identifier compatibility. |
| RESULT-DEC-014 | pass / fail preserve value/error state until explicit handling. |
Regression fixtures
The Result marathon added compiler fixtures bug646–bug674:
- bug646–bug651:
? fallbackandawaitparser shape. - bug652–bug657:
??,?|, anddefaultsprecedence. - bug658–bug663:
?!and?.. - bug664–bug668:
_?/_!,drop, andrawparity. - bug669–bug674: contextual
catch.
K coverage
K core grew from 182 to 192 tests across v0.33.x:
- 183–184:
? fallback. - 185–186:
?|and??value flow. - 187–188: source-level
?! fallback. - 189–190:
_!/_?desugar parity. - 191–192: contextual
catchsuccess/error flow.
K proof coverage grew from 12 to 13 modules with
result-catch-proofs.k.
Final v0.33.x validation snapshot
- Build: PASS.
- Focused Result bug runners: PASS.
- Broad non-K CTest sweep: 152/152.
- K core: 192/192.
- K proofs: 13/13.
- No new ARIA diagnostic codes were consumed; ARIA-068..ARIA-071 remain de-reserved by the final audit.