reasonml / reasonml/reason

Compile `{}` into something else than empty object

Open
#1,667 1 comment 1 reaction 0 assignees View on GitHub

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

  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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.