@as with optional field not working

Hey,

I’ve noticed you can’t rename an optional field with @as, like in this example:

type t = {
  @as("fooJs")
  foo?: int, // syntax error: I'm not sure what to parse here when looking at "?".
  bar: string,
}

Is that a known limitation?

(Only in first position it seems).
Should work with compiler 10.1

1 Like