Compile `{}` into something else than empty object
Open
Nobody has claimed this yet.
KIND: FEATURE REQUEST
Parser
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
People keep thinking that let f = () => {} gives them an empty function (what's that). We should probably compile it to emptyFunctionBodyPleaseFill and let it error. Once empty record lands, we can turn it into the syntax for empty records, if ever.
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
The issue names no files or tests. Start by tracing how the compiler handles let f = () => {} and determine where an empty block is emitted. Confirm the intended diagnostic for the proposed output, and add or update coverage so the expression no longer silently represents an empty function body.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100