rescript-lang/rescript

Arrow syntax for anonymous functions produces invalid output

Closed this issue · 0 comments

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
  });
}