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

Check does not notice erroneous types when assigning using nested ifs #375

Closed
JSAbrahams opened this issue Dec 21, 2022 · 0 comments · Fixed by #387
Closed

Check does not notice erroneous types when assigning using nested ifs #375

JSAbrahams opened this issue Dec 21, 2022 · 0 comments · Fixed by #387
Assignees
Labels
bug: check Something in the type check module isn't working (as intended)

Comments

@JSAbrahams
Copy link
Owner

Description of Bug

Check does not notice erroneous types when assigning using nested ifs.

How to Reproduce

def x := 20
def a: int := if x > 10 then
    if x > 30 then
        "a string"
    else
        x - 1
else
    x

Expected behavior

Should fail because a has type Int even though there is a possibility it could be a string.

@JSAbrahams JSAbrahams added the bug: check Something in the type check module isn't working (as intended) label Dec 21, 2022
@JSAbrahams JSAbrahams added this to the v0.3.5 | Error handling milestone Dec 21, 2022
@JSAbrahams JSAbrahams self-assigned this Dec 21, 2022
@JSAbrahams JSAbrahams linked a pull request Dec 27, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: check Something in the type check module isn't working (as intended)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant