Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support type asd = ~a:bool=? => int; #2056

Closed
chenglou opened this issue Jul 6, 2018 · 5 comments · Fixed by #2058
Closed

Support type asd = ~a:bool=? => int; #2056

chenglou opened this issue Jul 6, 2018 · 5 comments · Fixed by #2058
Labels
KIND: FEATURE REQUEST Parser parsing reason code into an AST

Comments

@chenglou
Copy link
Member

chenglou commented Jul 6, 2018

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

Dunno what conflict this has

@jaredly
Copy link
Contributor

jaredly commented Jul 6, 2018

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

@jaredly jaredly added KIND: FEATURE REQUEST Parser parsing reason code into an AST labels Jul 6, 2018
@chenglou
Copy link
Member Author

chenglou commented Jul 7, 2018

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

@jaredly
Copy link
Contributor

jaredly commented Jul 7, 2018

lol most parser errors are hard to figure out why atm

@chenglou
Copy link
Member Author

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.

@jordwalke
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
KIND: FEATURE REQUEST Parser parsing reason code into an AST
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants