Skip to content
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

looks like ref operator not converting correctly to refmt:3 #85

Open
idkjs opened this issue Nov 8, 2017 · 1 comment
Open

looks like ref operator not converting correctly to refmt:3 #85

idkjs opened this issue Nov 8, 2017 · 1 comment

Comments

@idkjs
Copy link

idkjs commented Nov 8, 2017

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

@idkjs idkjs changed the title looks like ref operator not converting correctly looks like ref operator not converting correctly to refmt:3 Nov 8, 2017
@hcarty
Copy link

hcarty commented Nov 8, 2017

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.

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

2 participants