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

Don't allow key + string #88

Merged
merged 4 commits into from
May 16, 2018
Merged

Conversation

Sei-Lisa
Copy link

Apart from a copy-paste too much, there was an entry in the table of valid operator types for key + string -> key. That's been removed, and a new test case has been added that covers every possible operator combination, to ensure there are no more problems of that kind.

There's a known bug in the handled operand types: integer *= float should be supported (see #16).

Some operators have a fixed return type. In these cases, to prevent a cascade of invalid operation errors, assign the return type of the operator, rather than that of the first operand.

That type happens to be integer in all cases handled.

This is especially important in the case of >= and <= because that's parsed as !(a < b) and !(a > b) respectively, and if there's a type mismatch in the inner operation, another error is raised in the ! operation, potentially confusing the user.
@Makopo Makopo merged commit 0fd9454 into Makopo:master May 16, 2018
@Sei-Lisa Sei-Lisa deleted the sei-fix-key-plus-string branch May 16, 2018 15:23
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

Successfully merging this pull request may close these issues.

2 participants