Reason: refmt produces untypable output for exception match cases

Created on 8 Jan 2017  路  3Comments  路  Source: reasonml/reason

refmt on

switch (f ()) {
| x => Some x
| exception (Sys_error _ as exc) => raise exc
};

yields

switch (f ()) {
| x => Some x
| exception Sys_error _ as exc => raise exc
};

which does not type-check with Error: Unbound value exc. Warning 11 (unused match case) is also triggered.

It seems that the parens in the exception match case are required for correct parsing, but refmt removes them anyway.

Most helpful comment

Made a pr with a fix above.

All 3 comments

Thanks, I'll get to this next.

Made a pr with a fix above.

Pretty good response rate we're getting =D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rickyvetter picture rickyvetter  路  3Comments

TheSpyder picture TheSpyder  路  3Comments

shaneosullivan picture shaneosullivan  路  3Comments

braibant picture braibant  路  4Comments

rickyvetter picture rickyvetter  路  4Comments