Error formatting: weird indentation on complex type error
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
(Following this thread https://twitter.com/MoOx/status/1068970511173074944)
I would like to report something that would need to be improved to help complex types debugging
When playing with graphql (with graphql_ppx), we end up having generated types. If we make a mistake when using graphql response, we will have error that might produce errors with a very unusual formatting

I think the situation should be improved by offernig a more simple indentation, or even better a diff (with colors/font-weight!). Diff would make sense if type to output is more than one line I guess.
Repro
git clone https://github.com/MoOx/dame.bio
cd dame.bio
git checkout issue-reason-error-formatting
yarn
yarn prepare step should trigger a bs compilation and should output the error.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Clone the linked dame.bio reproduction, check out issue-reason-error-formatting, install dependencies, and run yarn prepare to reproduce the formatting. Then trace the compiler path that produces the complex type error; done means the reproduced error has clearer indentation or comparison formatting, with updated coverage for the output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, ocaml
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100