Underscore application with infix operator produces invalid syntax with refmt
Open
Nobody has claimed this yet.
Printer
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
let divBy2 = (/)(_, 2);
After running refmt:
let divBy2 = _ / 2;
https://reasonml.github.io/en/try?rrjsx=true&reason=DYUwLgBAJglgbgIQJ4CYIF4IAoD0BKLAfQBoIU8BuIA
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
Start by reproducing the example with refmt, using the Reason playground link and the let divBy2 = (/)(_, 2); input. Trace how refmt formats an underscore application with an infix operator, then verify that the output remains valid Reason syntax rather than becoming let divBy2 = _ / 2;.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100