Skip to content

feat(typecheck): trait-method RT contracts (#766) - #1474

Merged
godofecht merged 3 commits into
mainfrom
feat/766-trait-rt-contracts-rebased
Oct 11, 2026
Merged

godofecht merged 3 commits into
mainfrom
feat/766-trait-rt-contracts-rebased

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Summary

Adds compile-time real-time contracts for trait methods, completing the trait dispatch slice of #766.

A trait method signature written after @rt_safe inside a trait block becomes a contract on every implementation of that method. Each implementing method is checked against the @rt_safe rules. Violations identify the implementation function and the trait method name.

The contract is erased before code generation.

Verification

  • compiler/fixtures/typecheck_rules/rt_safe_trait_impl_bad.flow
  • compiler/fixtures/typecheck_rules/rt_safe_trait_impl_ok.flow
  • tests/lang/test_rt_safe_trait.flow
  • ./compiler/scripts/bootstrap_from_c.sh --verify passed
  • ./flow tool compiler/scripts/self_host_full.flow passed
  • ./flow tool compiler/scripts/roundtrip.flow passed
  • ./flow tool compiler/scripts/parity_effects.flow passed
  • ./flow test-lang passed (297/297)

@godofecht
godofecht enabled auto-merge October 11, 2026 08:26
@godofecht
godofecht added this pull request to the merge queue Oct 11, 2026
Merged via the queue into main with commit e281c6d Oct 11, 2026
32 checks passed
@godofecht
godofecht deleted the feat/766-trait-rt-contracts-rebased branch October 12, 2026 23:02
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