@as with optional field not working


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

type t = {
  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