Open
Description
We currently have the following special directives for external function definitions:
@return(nullable)
external someFunc1: unit => option<string> = "someFunc"
@return(null_undefined_to_opt)
external someFunc2: unit => option<string> = "someFunc"
@return(undefined_to_opt)
external someFunc3: unit => option<string> = "someFunc"
@return(null_to_opt)
external someFunc4: unit => option<string> = "someFunc"
- 1 and 2 are actually the same.
- For 2, 3, and 4, the naming is unidiomatic (no camelCase, ...).
- 3 is probably not needed anymore as one could just define the external to return an option.
- 4 would be for a case where we know that the external function can return null, but not undefined. But in that case using 1 would work as well?
I would suggest to deprecate and eventually remove everything but @return(nullable)
(which is actually the only one that's documented BTW).