reasonml / reason-tools

Adds Reason to the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

looks like ref operator not converting correctly to refmt:3

idkjs opened this issue · comments

Its converting

let newItem () => {
  lastId := !lastId + 1;
  {id: !lastId, title: "Click a button", completed: true};
};

to

let newItem = () => {
  :=(lastId, lastId^ + 1);
  {id: lastId^, title: "Click a button", completed: true}
};

when maybe it should be:

let newItem = () => {
  lastId := lastId^ + 1;
  {id: lastId^, title: "Click a button", completed: true}
};

See: reason-tools share link

IIRC, the old syntax update the value in a reference was:

lastId = !lastId + 1;

I'm not sure := should be converted into prefix form like that, so there is still possibly a bug here.