Skip to content

Name state errors as a compiler would on the state machine - #168

Merged
CatarinaGamboa merged 2 commits into
mainfrom
feat/fsm-compiler-terms
Oct 27, 2026
Merged

CatarinaGamboa merged 2 commits into
mainfrom
feat/fsm-compiler-terms

Conversation

@CatarinaGamboa

@CatarinaGamboa CatarinaGamboa commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

The State Machine view described a state error in its own words: "x.m() is rejected when x is in state A · allowed in state B", with a legend of Call rejected, Call allowed and Allowed, but not reachable here for the possible and accepted states. It now uses the terms of a compiler error, as the Verification tab does (Expected / Found):

  • Summary: Invalid method call x.m() · expected state B or C · actual state A
    • expected lists every state that accepts the call (before, only the possible ones were listed, or all accepted ones when the state is unknown); actual lists the states the receiver may be in, or unknown.
    • with several state sets, one group per set, joined with and: expected state tilingSet and compressionExplicit · actual state startTiling and compressionExplicit.
    • when the error cannot be marked: Invalid method call x.m(), or Invalid method call at line N.
  • Legend: ✕ Actual state, not expected, ✓ Actual state, expected, Expected state (the dashed outline). The marks on the diagram are unchanged.
Before After

Second error of the same file, param.setCompressionQuality():

The summary drops the receiver, which is already in the call.

Testing

  • npm run test:unit (107 passed), tsc -p tsconfig.test.json, webpack build.
  • Checked in a headless VS Code on the ImageWriteParam study exercise (screenshots above).

Independent of #167 (shows the conditions by default); both touch the State Machine view but not the same lines.

🤖 Generated with Claude Code

The summary said the call is rejected when the receiver is in a state and
allowed in another, and the legend marked states as call rejected, call
allowed, or allowed but not reachable. Say invalid method call, then the
expected and actual states, as the Verification tab and compilers do, and
mark the actual states as expected or not and the other expected states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CatarinaGamboa added a commit that referenced this pull request Oct 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CatarinaGamboa added a commit that referenced this pull request Oct 26, 2026
@CatarinaGamboa
CatarinaGamboa merged commit d92f95f into main Oct 27, 2026
3 checks passed
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