Skip to content

Editor code actions generate failwith("TODO"), which no longer exists #9102

Closed

Description

@cristianoc

Found by a bug hunt over the 16 commits from eb087382 to cd641cbc.

#9052 removed failwith from Pervasives. The exhaustive-switch and add-missing-cases code actions still fill new branches with failwith("TODO"), and that code now fails to compile:

let f = (x: option<int>) => switch x { | None => failwith("TODO") | Some(_) => 1 }
The value failwith can't be found

At b123b7c3 the same code compiles with a deprecation warning.

The placeholder is built by Codegen.mk_fail_with_exp, which is used from type_utils.ml and codemod.ml. The analysis snapshots still expect it: tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt and Codemod.res.txt.

The changelog contradicts itself on the same point. changes/deprecated-let-without-interface.fix.md says failwith and invalid_arg now emit their deprecation warning, while changes/remove-v12-deprecated-stdlib.breaking.md removes them.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions