Skip to content

Arrow syntax for anonymous functions produces invalid output #7012

Closed
@cknitt

Description

@cknitt

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions