Skip to content

Clean up/optimize @return(undefined_to_opt) etc. #7428

Open
@cknitt

Description

@cknitt

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?
  • Only 1 is actually documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions