Skip to content

Array spreading still uses Belt #7005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nojaf opened this issue Sep 3, 2024 · 3 comments
Closed

Array spreading still uses Belt #7005

nojaf opened this issue Sep 3, 2024 · 3 comments

Comments

@nojaf
Copy link
Collaborator

nojaf commented Sep 3, 2024

See playground

let x = [ "a" ]
let y = [ ...x]

generates

// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';

let Belt_Array = require("./stdlib/belt_Array.js");

let x = ["a"];

let y = Belt_Array.concatMany([x]);

exports.x = x;
exports.y = y;
/* y Not a pure module */

I would expect Belt no longer be used for this. Given concatMany exists in Core.

With some pointers, I would be interested in taking a stab at this myself.

@zth
Copy link
Collaborator

zth commented Sep 3, 2024

This will be fixed as Core moves into the compiler in v12.

@nojaf
Copy link
Collaborator Author

nojaf commented Sep 3, 2024

Oh, I see, thanks for pointing that out!

@cknitt
Copy link
Member

cknitt commented Sep 3, 2024

This is already tracked in #6836.

@cknitt cknitt closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants