newtype / subscript / bounded probe, 2026-08-19
Provenance. This run was a Claude subagent spawned inside the author's own session, not an independent third party — see probe-model-comparison-2026-08-20.md. Every finding below was rebuilt on
mainbefore being written down, so the findings stand; the independence does not.
Verdict: 1 diagnostic bug, 1 index gap (fixed), 1 missing capability, 4 minor gaps. Probed 2026-08-19 with a 600-line limit order book. Outcome: headline is documentation, not language — 3 compiler errors in 600 lines, correct on first run.
A fresh agent built a 600-line price-time-priority limit order book across two packages: newtypes Price/Qty/OrderId/Trader, resting orders in bounded[LEVEL_CAP]Order, three subscripts, and a session driver. The program was discarded; this record is the artifact.
1. An arithmetic message states a rule that is not the rule
error: arithmetic requires two ints or two floats (got Price, Qty)
Price and Qty are both newtypes over int, so by the message's own terms they ARE two ints. Confirmed here: Price * Price compiles; Price * Qty does not. The real rule is that both sides must be the SAME type — the message describes a different one and sends the reader to convert, which is not the fix.
2. bounded[N]T is missing from the reference index, and nothing shows how to build one
docs/reference/index.md claims to catalogue every feature and contains zero occurrences of bounded. All prose lives in spec §5.3.10. The agent reported that no document shows how to CONSTRUCT one. That part was wrong — docs/reference/arrays-slices.md has a whole section with b: bounded[4]int = [1, 2] in it. The gap is that the index row never named bounded, so neither the agent nor the first write-up found the section; both grepped and concluded from the miss. Fixed by naming it in the index row.
3. pop and slicing are rejected on bounded, so it cannot be dequeued
A fixed-capacity queue cannot be drained from the front. The agent invented tombstone-and-rebuild. Both refusals carry a workaround in the message; the docs state only the prohibition, so a reader learns the shape by hitting it.
4. Smaller, all confirmed
- The
inoutdocs say the argument "must name a mutable variable"; the compiler also accepts a field place (&b.asks). The doc is narrower than the language, so the agent wrote an unnecessary fallback. - Forwarding an
inoutparameter still needs&at the inner call, and no doc example shows it. - Cross-package
subscriptcalls are undocumented —b.ask(i)works, including nested (b.bid(0).resting(0).qty = ..., checked at runtime). - The "subscript rooted in a fresh local" rule is unreachable: the single-
yieldrule fires first.
What went right
Three errors in 600 lines, and the program was correct on its first run. The work shipped earlier the same day showed up in the agent's own account: batched errors with quoted source, and diagnostics carrying a second location with the unmangled type and its declaration.
Newtype distinctness held across the package boundary. bounded refused the 9th order into an 8-slot level by name, with the cap in the message. The subscript behaved as a real place and chained through an inout array element. Zero warnings on the final build.