Structural inference (2a) covers cyclic classes; this adds the DEMAND half for the acyclic-but-aliased case, so @gc is now redundant everywhere. - owner.ml: a `promote` sink on ctx. In collect mode, a class value that would raise WO-E304 (escape) records its class instead of erroring — because a class that MUST escape cannot be owned (second-class borrows can't be stored or returned), so it must be traced. `class_of_ty` extracts the class from the escaping local's type. analyze/analyze_fn take ?promote. - main.ml typecheck_all: after structural injection, a fixpoint runs ownership in collect mode over every file, unioning promotions into syms.traced (and every module table), before owner/emit see it. Terminates (promotions only grow, bounded by class count). - gcinfer.render_final: --dump-gc now reads the authoritative is_gc_class (structural + demand + the remaining @gc bridge), with the reason. Effect: a class that escapes is inferred `gc` with no annotation — e.g. `Cache` (rc.wo sans @gc) shows `gc (alias escape (demand))`; `Box` returned out of `leak` is promoted and the program is valid. No false positives: employee's Department/Employee stay owned; the 566 goldens + 14 test_diag unchanged. Corpus: compile-fail/borrow-escape-return reclassified to run/ (prints 1) — returning a borrowed class is now legal under demand promotion; the fixture encoded pre-7b behavior. Verified: woc-test 566/0 + test_diag 14/0; oop-e2e 79/0; employee 8/0; log-watcher 7/0. NOT in this slice: removing the `@gc` KEYWORD (parser rejection + rewriting the RC/@gc golden + test_diag assertions + moving the inference injection into the library so unit tests see it) — coupled to Phase 3, which deletes the RC machinery those tests cover. The ring still needs Phase 3 to RUN (nullable `?Node` gcref path). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| actor | ||
| compile-fail | ||
| db | ||
| gc | ||
| lang | ||
| run | ||
| sample-logwatcher | ||
| sys | ||
| trap | ||
| README.md | ||
tests/corpus/ — the conformance spine
Fixture kinds, exact-outcome matching (byte-equal stdout / exact WO-E### / exact trap code / exact gc step+freed counts):
| dir | kind | landed by plan |
|---|---|---|
run/ |
compiles + runs, expected stdout | 3 |
compile-fail/ |
must fail with expected WO-E### |
3–4 |
trap/ |
must trap with expected code | 3–4 |
gc/ |
cycle collection scenarios | 3 |
actor/ |
shard/spawn/send (ASan+TSan) | 4 |
db/ |
insert/select + crash/replay | 5 |
lang/ |
Haxe-parity adoptions | 8 |
sys/ |
fs/proc/net/time/json stdlib | 9 |
sample-logwatcher/ |
ported log-watcher fixtures | 10 |
Runner: scripts/oop-e2e.sh (plan 3, task 2 — includes the how-to-add-a-fixture doc pointer docs/plan/oop-vm/02-corpus.md).