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

Repeated asserts are ignored? #181

Closed
benley opened this issue May 17, 2016 · 5 comments
Closed

Repeated asserts are ignored? #181

benley opened this issue May 17, 2016 · 5 comments

Comments

@benley
Copy link
Contributor

benley commented May 17, 2016

Is this expected behavior somehow?

{
  assert true,
  assert false,  // This should fail, but it doesn't!
}
@benley
Copy link
Contributor Author

benley commented May 17, 2016

For comparison, this works correctly and yields an Assertion failed error:

assert true;
assert false;
null

@benley
Copy link
Contributor Author

benley commented May 17, 2016

And this might be a parser bug?

[
  assert true;
  assert false;
]

yields Unexpected: "]" while parsing terminal

If there is a value in the list after the last assert it parses correctly, but the repeated asserts are still ignored.

@sparkprime
Copy link
Contributor

{ assert true, assert false } is a bug

assert true; assert false; null is WAI

the last case is WAI as a parse error, because arrays do not have self or get extended, you don't get to put assert in them like you can with objects. You can however use assert expressions within array elements or outside the array.

I will look into the first case...

@benley
Copy link
Contributor Author

benley commented May 18, 2016

Cool - thanks for the explanation!

@sparkprime
Copy link
Contributor

Note also #185 but that's more of an edge case.

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

2 participants