Skip to content

bytes_to_string is missing #5573

@TheSpyder

Description

@TheSpyder

Using 10.0.0-beta.3 I'm getting an error in my bundler:

▲ [WARNING] Import "bytes_to_string" will always be undefined because there is no matching export in "node_modules/rescript/lib/es6/caml_bytes.js"

    node_modules/rescript/lib/es6/char.js:67:26:
      67 │         return Caml_bytes.bytes_to_string(s);
         ╵                           ~~~~~~~~~~~~~~~

And tracking down that JS to the OCaml library code, it's coming from char.ml's use of unsafe_to_string.
https://github.com/rescript-lang/rescript-compiler/blob/375cc68473d08d8357531b7cb48a91fec27a34f5/jscomp/stdlib-406/char.ml#L27-L47

Now, unsafe_to_string does exist in bytes.ml:
https://github.com/rescript-lang/rescript-compiler/blob/375cc68473d08d8357531b7cb48a91fec27a34f5/jscomp/stdlib-406/bytes.ml#L158
But char is using %bytes_to_string which compiles to Caml_bytes.bytes_to_string.

It looks like the caml_bytes.ml code was deleted in May 2021, which is also when bytes.ml had the implementation added, but the usages of it weren't updated.
5215218#diff-0dd01a00ddd500dee6f9586505eae3c732df832649a86d5770e2c2f454e9626bL123-L124

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions