You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Adds **class-level coverage** for the "inline extern fed to every
downstream consumer" surface that produced the PR #346 `FnExtern` interp
bug (`Interp.eval_decl`'s `TopFn` arm missing the `FnExtern` match arm —
silent pattern-match failure since the interpreter was written; fired
the moment STDLIB-04a's tests became the first to hand an inline `extern
fn` to `Interp.eval_program`).
Queued as a [comment on PR
#346](#346 (comment))
in the previous session; this is the follow-up.
## What this PR adds
Four fixtures under `test/e2e/fixtures/`:
| Fixture | Shape |
|---------|-------|
| `inline_extern_pure.affine` | `extern fn host_pure_identity(x: Int) ->
Int;` (no effects) |
| `inline_extern_effectful.affine` | `extern fn host_log(msg: String) ->
Unit / IO;` (effect row) |
| `inline_extern_polymorphic.affine` | `extern fn host_identity[T](x: T)
-> T;` (type params) |
| `inline_extern_type_consumed.affine` | `extern type Handle; extern fn
host_use(h: Handle) -> Int;` |
Each fed through **parse → resolve → typecheck → interp** via the new
`inline_extern_pipeline_ok` helper in `test/test_e2e.ml`. Assertion: all
four phases return `Ok`. A regression that re-introduces the silent
pattern-match-failure path that broke main between #334 and #346 would
fail loudly here instead.
Suite registered as `"E2E Inline Extern Shapes (Refs #346)"`.
## Why this matters
Per the `.claude/CLAUDE.md` §"Test-fixture hygiene for latent bug
surfaces" rule landed this session: when adding a stdlib `extern fn` (or
any other new declaration shape), test it against **every downstream
consumer** (parse / resolve / typecheck / interp / codegen). PR #346
fixed *one* instance of this class; this PR pins the *class* against the
gate so the next latent gap of the same shape (an `extern type` consumed
by an `extern fn` in a module that other modules import, etc.) surfaces
against CI rather than against the next agent.
## Test plan
- [ ] CI `build` job clean
- [ ] CI `dune runtest` — four new alcotest cases pass; existing suite
unchanged
- [ ] No new lints
Refs #346, Refs `.claude/CLAUDE.md` §"Test-fixture hygiene for latent
bug surfaces"
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WHUYQEPKgQU6jBgUj4snYU)_
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments