Skip to content

s2/flow: constructors allocate in the Region in scope - #11

Merged
vic merged 1 commit into
mainfrom
flow-alloc
Nov 9, 2026
Merged

vic merged 1 commit into
mainfrom
flow-alloc

Conversation

@vic

@vic vic commented Nov 9, 2026

Copy link
Copy Markdown
Owner

FLOW rung (parity F4): a constructor call is an alloc step on the one Region capability in scope (s1 check.srs:708-716).

  • Flow.Cx also carries the enums, and Flow.check takes the Cx.
  • No Region, or two: the names check reports it.
  • Not yet: a spec def allocates nothing (the s2 Ast has no spec marker).

Tests: tests/neg/alloc_after_free.srs (stuck at the Cons after r.free()), a constructor in an open region, tests/neg/call_freed.srs (two {r: Region} needs r Open) and the body of two. Mutant: constructors not recognized, and alloc_after_free passes. Local tests/run.sh: 182 ok, 0 FAIL.

Flow.Cx also carries the enums, and Flow.check takes the Cx. A call of an enum case (with args: a
nullary case takes no ()) is an alloc step on the one Region capability in scope, as s1 chkCtor. With
no Region or two, the names check reports it. Not yet: a spec def allocates nothing (the s2 Ast has no
spec marker).

tests/s2/flow: tests/neg/alloc_after_free.srs (stuck at the Cons after r.free()), a constructor in an
open region, tests/neg/call_freed.srs (two {r: Region} needs r Open) and the body of two. Mutant:
constructors not recognized, and alloc_after_free passes.
@vic
vic merged commit 2d68c0f into main Nov 9, 2026
3 checks passed
@vic
vic deleted the flow-alloc branch November 9, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant