fix(builder): reject second when in same profile #39

Merged
yorunikakeru merged 1 commit from fix/issue-30-sequential-when into main 2026-06-15 13:54:55 +02:00
Owner

Summary

  • DSL.Builder.when now returns Left DuplicateCondition if ssCondition is already set, instead of silently discarding the first condition and gating all accumulated actions under the second one
  • Added DuplicateCondition constructor to IR.Domain.Error (IR commit 017a619)
  • Regression test in DSL.BuilderSpec covering the exact scenario from the issue

Closes #30

Test plan

  • cabal test — 87/87 pass
  • Verify profile "p" $ do { when condA ...; when condB ... } returns Left DuplicateCondition
## Summary - `DSL.Builder.when` now returns `Left DuplicateCondition` if `ssCondition` is already set, instead of silently discarding the first condition and gating all accumulated actions under the second one - Added `DuplicateCondition` constructor to `IR.Domain.Error` (IR commit 017a619) - Regression test in `DSL.BuilderSpec` covering the exact scenario from the issue Closes #30 ## Test plan - [x] `cabal test` — 87/87 pass - [x] Verify `profile "p" $ do { when condA ...; when condB ... }` returns `Left DuplicateCondition`
fix(builder): reject second when in same profile
Some checks failed
CI / linux (pull_request) Failing after 1m5s
45c7d9e196
Second when call silently overwrote ssCondition while keeping all
accumulated actions, causing both actions to be gated on the second
condition with the first silently lost. Now returns DuplicateCondition.

Closes #30
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
FrogOS/DSL!39
No description provided.