Skip to content

Add support for [@mel.unwrap] in @mel.obj #679

@jchavarri

Description

@jchavarri

Ported from rescript-lang/rescript#2827 (cc @liubko as original author).

Can't use [bs.unwrap] with labeled arguments.

Code

[@bs.obj]
external func :
  (
    ~param: string,
    ~polyParam: [@bs.unwrap] [ | `Str(string) | `Int(int)],
    unit
  ) =>
  _ =
  "";

Error

@obj label polyParam does not support @unwrap arguments

Playground link.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions