rescript-lang / rescript-lang/rescript
Unintelligible error message with @return(nullable)
Open
@cknitt is already working on this.
Since May 5, 2025.
enhancement
- Dominant language
- OCaml
- Stars
- 7.5k
- Forks
- 485
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 55
Description
When you have @return(nullable) on an external definition for a function that does not return option, e.g.,
@return(nullable)
external someFunc: unit => bool = "someFunc"
you get the following rather incomprehensible error message:
%@return directive *_to_opt expect return type to be
syntax wise `_ option` for safety
Contributor guide
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.
Assessment
This issue has not been assessed yet.