Skip to content

Arrow syntax for anonymous functions produces invalid output #7012

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
cknitt opened this issue Sep 5, 2024 · 0 comments · Fixed by #7013
Closed

Arrow syntax for anonymous functions produces invalid output #7012

cknitt opened this issue Sep 5, 2024 · 0 comments · Fixed by #7013
Assignees
Labels
Milestone

Comments

@cknitt
Copy link
Member

cknitt commented Sep 5, 2024

On current master:

type t = {a: int, b: int}

let f = () => () => Some({a: 1, b: 2})

compiles to

function f() {
  return () => {
    a: 1,
    b: 2
  };
}

which is invalid. It would need to be

function f() {
  return () => ({
    a: 1,
    b: 2
  });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants