- `woc` now emits `.wob` that `wovm` runs: emit.ml lowers the typed, owner-annotated AST (scope-stack registers with a >64 WO-E401 diagnostic, Lua-style call windows, ICALL by slot, dedup const pool, drop maps, line tables, implicit terminators); disasm.ml backs `--dump-bc` goldens. - Ownership lowering consumes the four owner tables verbatim; RESIDUAL is the only source of borrow ops, coalesced per operand. Review caught the emitter consuming only 2 of owner.ml's 4 residual producers — an assignment-anchored aliasing violation ran to exit 0 instead of trapping; fixed, plus a backstop raising WO-E404 for any residual region left unconsumed. - Conformance harness `scripts/oop-e2e.sh` (`just oop-e2e`): four fixture kinds with exact outcomes — byte-exact stdout, one WO-E### anchored on `error CODE:`, numeric trap code, gc trace. 25 fixtures incl. pricing-demo logic, the ownership suite, and DB_STUB's parse-but-trap. `tests/` un-ignored so the corpus is actually tracked. - `woc build` produces a self-contained binary: wovm copy + appended image + 20-byte trailer, self-exec via /proc/self/exe. Verified relocated outside the repo, argless, and against adversarial trailer corruption. - Milestone 1's five spec criteria all MET (`just oop-accept`). Criterion 3 closed by WO-E405 — the entry must return `Int`, since program mode already says its return value is the exit code — which deletes the leak class without adding return-type metadata to the format. `gc/held-cycle` retired: an externally-held cycle is not expressible in a post-exit pump. - New spec: inferred GC + incremental per-shard tri-color mark-sweep, retiring `@gc` and reference counting. Story gains iterations 7b (that work) and 9b (`@table`, relations, compiler-checked query); `.dev/reference` gains a sparse System.Linq checkout. Priority: 5→6→7 (log-watcher) then 7b, 8, 9, 9b.
34 lines
1.3 KiB
Text
34 lines
1.3 KiB
Text
-- KNOWN GAP, pinned deliberately (Task 4 review, Important 2). `Rock`
|
|
-- does not have a `current_price` method, so it does not structurally
|
|
-- satisfy `Priced` -- and its full method set is known at compile time,
|
|
-- so this violation IS provable statically. By the hybrid-boundary
|
|
-- doctrine (provable -> compile-time, unprovable -> runtime) this ought
|
|
-- to be WO-E205 (unsatisfied-interface) at the `quote(r)` call site.
|
|
--
|
|
-- It isn't: WO-E205 is declared in types.ml but has no call site today
|
|
-- (docs/plan/oop-vm/01-error-catalog.md). This compiles clean (exit 0,
|
|
-- zero diagnostics) and the unsatisfied call instead reaches `wovm` as
|
|
-- an `ICALL` with no matching vtable entry, which traps `WO_T_BOUNDS`
|
|
-- (6) -- "no vtable entry for receiver class". That is the CURRENT,
|
|
-- observed behavior this fixture pins, not the desired one.
|
|
--
|
|
-- When WO-E205 is implemented, this exact program must start failing to
|
|
-- *compile* instead -- move this fixture to compile-fail/ with
|
|
-- fixture.code WO-E205 in the same change that wires the check, rather
|
|
-- than leaving a stale trap/ fixture silently describing dead behavior.
|
|
interface Priced {
|
|
fn current_price() -> Int
|
|
}
|
|
|
|
class Rock {
|
|
n: Int
|
|
}
|
|
|
|
fn quote(p: Priced) -> Int {
|
|
return p.current_price()
|
|
}
|
|
|
|
fn main() {
|
|
let r = Rock { n: 1 }
|
|
print_int(quote(r))
|
|
}
|