P6A-11, P6A-12: malformed lowering is an internal compiler error; source type-check completeness

P6A-11: when a .aji module passed the frontend but its AIR does not parse
(E0001-E0005) or has invalid SSA/CFG (E5001, E5002), the result is one
E7900 source.internal_compiler_error at the source construct, with the
AIR code in air_code; semantic codes (E0006 included) are unaffected.
Unit test injects the checkpoint's `ret %` defect.

P6A-12: source-decidable type errors are E7005 at the source:
- `as` checks lossless widening with the verifier's own rule (shared
  function), and that both sides are integers
- slice.copy element types; own.free / region.destroy operand types
- element rules of channel.make<T> and mutex.make (no borrow, scope,
  task, shield or guard, at any depth)
Probing every source position found no other E1001/E1002 leak. The old
test encoding the previous rule (verifier_widen, E1002) is replaced by
typecheck/lossy_widen (E7005); 9 typecheck tests. Spec 15 §10 states the
frontend/verifier boundary.
This commit is contained in:
dev committed 2026-10-05 18:10:53 +03:00
1 parent 154c39865f
commit 748eddf4e5
16 files changed
+249 -14

No files matched your search

+1
View File
@@ -71,6 +71,7 @@ pub const registry = [_]Code{
.{ .id = "E7005", .kind = "source.type_mismatch", .meaning = "Expression has the wrong type in a source position" },
.{ .id = "E7006", .kind = "source.invalid_construct", .meaning = "Construct not allowed here" },
.{ .id = "E7007", .kind = "source.ambiguous", .meaning = "Source meaning cannot be determined" },
.{ .id = "E7900", .kind = "source.internal_compiler_error", .meaning = "The frontend produced invalid AIR for this construct: a compiler bug, not a program error; fields `air_code`, `air_message`" },
// T0xxx — Runtime traps (reported in trap records, not by the verifier)
.{ .id = "T0001", .kind = "trap.explicit", .meaning = "`trap` instruction executed" },
.{ .id = "T0002", .kind = "trap.assert", .meaning = "Assertion failed" },