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

Update syntax does not work with subtraction #460

Open
pschachte opened this issue Apr 24, 2024 · 1 comment
Open

Update syntax does not work with subtraction #460

pschachte opened this issue Apr 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@pschachte
Copy link
Owner

For example, the following do not compile:

!x - 1   # should decrement x
10 - !x  # should subtract x from 10

These elicit these compiler errors:

test-cases/final-dump/minus_update.wybe:4:2: Ambiguous overloading: call could refer to:
    wybe.int.-<3>
    wybe.int.-<0>
test-cases/final-dump/minus_update.wybe:5:1: Ambiguous overloading: call could refer to:
    wybe.int.-<3>
    wybe.int.-<0>

I suspect this is caused by some kind of conflict with unary subtraction.

@pschachte pschachte added the bug Something isn't working label Apr 24, 2024
@pschachte
Copy link
Owner Author

This is hard to fix because of the way type checking runs first, followed by mode checking. Considering only types without looking at modes, we can't distinguish unary negation from something like !x - 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant