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

Add well-formedness check for weird standalone statements #383

Closed
jpolitz opened this issue Nov 23, 2014 · 3 comments
Closed

Add well-formedness check for weird standalone statements #383

jpolitz opened this issue Nov 23, 2014 · 3 comments
Assignees

Comments

@jpolitz
Copy link
Member

jpolitz commented Nov 23, 2014

There are a number of expressions that really ought to not appear on their own line. For example,

e1 == e1

especially in a a check block, is probably a mistake. Similarly, a lone identifier, binops, object lookup with dot, and underscore expressions have little reason to appear on their own before the end of a multi-statement block. (Yes, binops could call side-effecting code and be useful... but that's a programming pattern I think we should be happy to disallow).

We should add a well-formedness check to look for these cases. Especially the equality case above should get special treatment, because the user often will have meant e1 is e2.

@blerner
Copy link
Member

blerner commented Dec 11, 2014

Relevant: #363

@sorawee
Copy link
Contributor

sorawee commented Dec 12, 2014

See also: #410

@shriram
Copy link
Member

shriram commented Jul 1, 2018

I'm pleased to note that the original report was not frivolous — the issue clearly has staying power. (-:

@jpolitz jpolitz closed this as completed in 04687a5 Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants