Reason: Support `type asd = ~a:bool=? => int;`

Created on 7 Jul 2018  路  5Comments  路  Source: reasonml/reason

Right now you need to wrap in parens: type asd = (~a:bool=?) => int;

Dunno what conflict this has

FEATURE REQUEST Parser

Most helpful comment

tbh I like requiring parens there. type asd = ~a:bool=? => int; is hard for me to visually parse

All 5 comments

tbh I like requiring parens there. type asd = ~a:bool=? => int; is hard for me to visually parse

We can still format to the latter; just that this currently throws a parser error and it's hard to figure out why

lol most parser errors are hard to figure out why atm

Merged the diff; I understand that we don't want to support this, and tbh I won't document this. It's just one of the several places where we relax the parser (e.g. for semicolon and switch braces too) for now. If we can't have great error messages here, might as well have good recovery first. We can remove this feature later.

We should make notes in the parser which rules are not important to keep around, so that one day when a conflict comes up with a more important feature, we know we can easily delete it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rickyvetter picture rickyvetter  路  4Comments

bloodyowl picture bloodyowl  路  3Comments

bobzhang picture bobzhang  路  3Comments

TheSpyder picture TheSpyder  路  3Comments

ondrejsevcik picture ondrejsevcik  路  3Comments