writeonce/docs/plan
shoney.arickathil 2a98186259 feat(compiler): let-type annotations, container literals, statics, pub(read)
Driving goal: compile docs/examples/log-watcher (1285 lines of .wo).
Diagnostics on that program: 481 -> 379; parse errors 85 -> 18.
tests/corpus via scripts/oop-e2e.sh stays 71 checks / 0 failures.

- ast.ml: `Let.ty` is a full `field_ty` (was a bare name), so `multi Text`,
  `map<K, V>` and `?T` annotate a local; new `ListLit`/`MapLit` expressions;
  `method_decl.is_static`; `field.pub_read`
- parser.ml: let annotations go through parse_field_ty; `[]`/`[a, b]` and
  `{}` literals in expression position; `static const`/`static fn` in class
  bodies (one token of lookahead — `static` stays an identifier);
  `pub(read) field: T`; a `;` ends a statement on its own, so one-line
  guard bodies (`{ skip(...); return; }`) parse
- emit.ml: list/map literals lower to multi_new/map_new + one multi_push per
  element, element kinds from the destination's declared type (WO-E403 with
  no typed destination, same rule multi_new already had); `static fn` gets a
  receiverless method record (arg_cnt = params) and lowers `Cls.fn(args)`
  through emit_direct with no `self`; a static can satisfy no interface
- types.ml: a written `let` annotation is now the authority for the binding's
  type (the only thing that types `[]`/`{}`/`nil`); `static_method_of` +
  static-call return types; method_info.is_static is wired from the AST
- owner.ml: container literals are fresh owned values, elements read in place
  (inherits push()'s open borrowed-element gap, noted in the code)
- plan doc: `Spec:` header line so planboard's lint accepts the plan

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 16:22:47 +02:00
..
compiler feat(compiler): let-type annotations, container literals, statics, pub(read) 2026-08-14 16:22:47 +02:00
done update msg 2026-08-12 15:16:29 +02:00
exploration docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
oop-vm feat(compiler): iteration 5 Tasks 1-4 — modules, language surface, switch, typedef records + enum variants 2026-08-12 14:40:07 +02:00
05-hand-rolled-json.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
06-bespoke-error.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
07-inotify-content-watcher.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
08-sendfile-static-assets.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
09-concurrency-scaleout.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
10-storage-foundations.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
11-wal-and-recovery.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
12-engine-disk-cutover.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
13-class-model-live-pricing.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
14-mvc-ui-implementation.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
15-mcp-streamable-http.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
16-postgres-mirror.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
discarded.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00
learnings.md docs: status board at docs/00-status.md; gap-closure spec applied; recover lost doc 2026-08-10 23:42:26 +02:00