Repository navigation
Conversation
Why:
The exhaustive-switch and add-missing-cases code actions filled new
cases with `failwith("TODO")`, but #9052 removed `failwith`, so the
generated code no longer compiled. They now use `%todo`, as the
exhaustive-switch completion already does.
Format modified (code action output):
Example:
let f = (x: option<int>) => switch x { | Some(_) => 1 }
Before (rescript):
switch x {
| None => failwith("TODO")
| Some(_) => 1
}
After (rescript):
switch x {
| None => %todo
| Some(_) => 1
}
The deprecated-let changelog fragment no longer says that `failwith` and
`invalid_arg` warn, since they are removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gGkPma9LAZimuQjnrP
Signed-off-by: Christoph Knittel <ck@cca.io>
Changelog🐛 Bug fix
Semantic Diff1 commit · Full page Fill generated switch cases with %todof6de2bb · cknitt + Claude · Oct 28, 2026, 15:22 UTC
Format modified (code action output) let f = (x: option<int>) => switch x { | Some(_) => 1 }
switch x {
-| None => failwith("TODO")
+| None => %todo
| Some(_) => 1
}The deprecated-let changelog fragment no longer says that |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9110 +/- ##
==========================================
- Coverage 81.46% 81.46% -0.01%
==========================================
Files 460 460
Lines 64675 64673 -2
==========================================
- Hits 52689 52687 -2
Misses 11986 11986
🚀 New features to boost your workflow:
|
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-9110 |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The exhaustive-switch and add-missing-cases code actions fill the cases they add with a placeholder. Since #9052 removed
failwithfromPervasives, that placeholder,failwith("TODO"), no longer compiles ("The value failwith can't be found").Type_utils.Codegen.mk_fail_with_expis replaced bymk_todo_exp, which builds%todoinstead. This is what the exhaustive-switch completion already inserts; it compiles with the "Todo found" warning and throws at runtime, so the generated code keeps its meaning. Both code actions go through this one function.The
ExhaustiveSwitchandCodemodanalysis snapshots now expect%todoin the generated cases.The issue also points out that
changes/deprecated-let-without-interface.fix.mdsaysfailwithandinvalid_argnow warn, contradicting their removal; that sentence is dropped.Fixes #9102
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kbf3gGkPma9LAZimuQjnrP