Skip to content

Add otherwise to when - #134

Merged
wseaton merged 2 commits into
mainfrom
when-otherwise
Sep 22, 2026
Merged

wseaton merged 2 commits into
mainfrom
when-otherwise

Conversation

@wseaton

@wseaton wseaton commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

when = gate.area, otherwise = True takes every label of the question that no other task lists and the question does not drop, uncertain included.

Expanded at compile time in workflow(), once every task is known. The generated TOML carries the expanded list, so exhaustiveness checking and the runtime are unchanged. An unreachable otherwise, otherwise with answers, otherwise without when, and answers = [] are compile errors at the argument.

`when = gate.area, otherwise = True` takes every label of the question
that no other task lists and the question does not drop, `uncertain`
included.

The labels other tasks list are not known when a task is constructed, so
the constructor records the task and workflow() expands it once it has
the full task list. The generated TOML carries the expanded list and no
`otherwise`, so exhaustiveness checking and the runtime are unchanged.

Compile errors at the argument: an unreachable otherwise, otherwise with
answers, otherwise without when, and `answers = []`.

Assisted-by: Claude
@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown

Docs preview for this PR is built and attached as the docs-preview artifact.

Download docs-preview, unzip, and open index.html in a browser.

Rebuilt for af348ac.

@wseaton
wseaton merged commit 1ec94b3 into main Sep 22, 2026
5 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