Reason: Proper error when using unit in function type declaration

Created on 8 Dec 2018  路  1Comment  路  Source: reasonml/reason

I am relatively new to ReasonML, but coming from a rich FlowType background. I tried to do:

type a = () => string;

And received the cryptic error message in try Reason:

<syntax error>

And a proper syntax error message in Merlin (which was not useful as well)
I turned to the docs and discovered I should have done:

type a = unit => string;
Error messages Parser

Most helpful comment

Yeahhh. imo it would be great to have the parser just accept () as an alias for unit in the type position

>All comments

Yeahhh. imo it would be great to have the parser just accept () as an alias for unit in the type position

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bobzhang picture bobzhang  路  3Comments

modlfo picture modlfo  路  4Comments

rickyvetter picture rickyvetter  路  3Comments

kyldvs picture kyldvs  路  3Comments

aaronshaf picture aaronshaf  路  3Comments