← Back to AILP Home

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:

K coverage

K core grew from 182 to 192 tests across v0.33.x:

K proof coverage grew from 12 to 13 modules with result-catch-proofs.k.

Final v0.33.x validation snapshot