Skip to content

Effect sets on function signatures (ILO-361 Phase 3 MVP)#672

Merged
danieljohnmorris merged 4 commits into
mainfrom
feature/effect-sets
May 22, 2026
Merged

Effect sets on function signatures (ILO-361 Phase 3 MVP)#672
danieljohnmorris merged 4 commits into
mainfrom
feature/effect-sets

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

  • Adds optional ^variant|variant effect-set clause to function signatures, written after the return type: process order:order > R order t ^invalid|timeout
  • Verifier infers which error string literals appear in ^expr positions in Result-returning function bodies and emits ILO-E001 warning when the declared set is narrower than the inferred set
  • New ilo check --show-effects flag prints inferred (and declared) effect sets for every function in a file

MVP shape

This is the inference + annotation surface only. Full enforcement (superset check at call sites, integration with Phase 2 fix plans) is filed as follow-up per the ticket scope.

  • Syntax: f x:n>R n t ^invalid|timeout;body
  • ^ sigil mirrors existing ^err match-arm syntax
  • No annotation = existing behaviour unchanged (backwards compatible)
  • ILO-E001 warning when declared set misses an inferred variant
  • --show-effects CLI flag for auditing and annotation authoring
  • 8 new targeted tests (3 parser, 5 verifier)

Test plan

  • cargo test — all 4,773 tests pass, 0 failures
  • ilo check examples/effect-sets.ilo --show-effects — shows correct inferred sets
  • Mismatch warning fires with actionable hint
  • Unannotated functions unchanged (no warnings)

Closes ILO-361

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@danieljohnmorris danieljohnmorris added the mini Created by mini PC autonomous workflow label May 22, 2026
@danieljohnmorris danieljohnmorris force-pushed the feature/effect-sets branch 3 times, most recently from bda26b8 to ac26ffe Compare May 22, 2026 10:46
Daniel Morris and others added 4 commits May 22, 2026 18:20
Introduces optional `^variant|variant` effect-set annotations on
Result-returning function signatures. The verifier infers which error
literals propagate from each function body and emits ILO-E001 warnings
when the declared set is narrower than the inferred set. The new
`ilo check --show-effects` flag prints inferred (and declared) effect
sets for all functions in a file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@danieljohnmorris
Copy link
Copy Markdown
Collaborator Author

mini pc is reviewing this

@danieljohnmorris danieljohnmorris merged commit e00cf3e into main May 22, 2026
1 of 10 checks passed
@danieljohnmorris danieljohnmorris deleted the feature/effect-sets branch May 22, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mini Created by mini PC autonomous workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant