Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

bs.open does not convert from ReasonML #185

Closed
@jfrolich

Description

@jfrolich
exception Error(string);

let handlePromiseFailure =
  [@bs.open]
  (
    fun
    | Error(_) => ()
  );

Formats into

exception Error(string)

let handlePromiseFailure = x =>
  switch x {
  | Error(_) => ()
  }

The whole @bs.open is gone. I also have no idea how to express the code in the new rescript syntax.

https://rescript-lang.org/try?ext=re&code=KYDwxsAOAuCWD2A7ABAUQE7vugFAZ2nVkQHMBKAbgCgqAbYaZACwENEATegBSwFtY8wAGItYtAK7pgyALxVkyANoABAEZ4AdPEjBEAXXnIchhQDNxiE8gA+aTNhwB9MrIB8RsocpUgA

I think this is not a legacy way of handling exceptions as it has been introduced in 0.7 (https://github.com/rescript-lang/rescript-compiler/blob/master/site/docsource/Exception-handling.adoc#bsopen-type-safe-external-data-source-handling-since-170).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions