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

Fix type unification between different sized integers. #456

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

otrho
Copy link
Contributor

@otrho otrho commented Dec 14, 2021

We weren't reporting downcasts as warnings because we had the order of 'received' and 'expected' types reversed.

Sometimes with unification it doesn't matter which types are which, but often there's definitely a 'received' and 'expected' type, and when there's a type error we report them as such. So most of this change is actually just renaming the args to unify() from a and b to received and expected.

But also, in particular I've changed the integer check and fixed the downcast warnings. We were assuming that the received type was the desired type but actually the expected type is where the casting should be made to.

@otrho
Copy link
Contributor Author

otrho commented Dec 14, 2021

The fix_opcode_bug E2E test is now reporting the downcast for its return value too.

@otrho otrho merged commit 53dd3d0 into master Dec 14, 2021
@otrho otrho deleted the toby/fix_downcasting_integers branch December 14, 2021 01:09
@adlerjohn adlerjohn added bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged labels Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants