reasonml / reasonml/reason

Kill all `assert false` in printer

Open
#1,658 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Printer
Dominant language
OCaml
Stars
10.3k
Forks
438
PR merge metrics
No merged PRs in 30d

Description

There are way too many of them, and they give really bad error messages to the user, e.g. #1611.

assert false should really only be used when the condition can't be achieved. Everything else should be Invalid_argument. We look super lazy with our error handling otherwise

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by searching the printer implementation for every assert false occurrence and determine which cases are reachable rather than impossible. Replace reachable failures with Invalid_argument, then verify that printer error messages are improved without changing impossible-state assertions.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.