Skip to content

Improve type resolution on expressions involving integers #128

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

Merged
merged 4 commits into from
Dec 12, 2023

Conversation

cirras
Copy link
Collaborator

@cirras cirras commented Dec 10, 2023

This PR significantly improves type resolution for binary and unary expressions with integer operands.

Changes are based on the following data tables:

Other notable changes:

  • Only intrinsic operator overloads that are relevant to the operands will be considered
    • (e.g. adding 2 records should not consider the intrinsic (Integer, Integer): Integer overload)
  • Subranges of integers are now modeled more correctly as IntegerType instances
  • Corrected the name of the bitwise not operator from BitwiseNot to OnesComplement

@cirras cirras requested a review from zaneduffield December 10, 2023 23:32
Copy link
Collaborator

@zaneduffield zaneduffield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good overall. I'm impressed how easy you made it look to perfectly emulate the operator overload behaviour.

My only real feedback is regarding some naming.

@cirras cirras force-pushed the expression_type_resolution branch from 0a7714d to 40bf9cb Compare December 12, 2023 01:52
@cirras cirras requested a review from zaneduffield December 12, 2023 01:53
@cirras cirras force-pushed the expression_type_resolution branch from 40bf9cb to 3422ab5 Compare December 12, 2023 02:23
Copy link
Collaborator

@zaneduffield zaneduffield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@zaneduffield zaneduffield merged commit 3836cd1 into master Dec 12, 2023
@zaneduffield zaneduffield deleted the expression_type_resolution branch December 12, 2023 02:44
@cirras cirras linked an issue Dec 12, 2023 that may be closed by this pull request
2 tasks
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.

RedundantCast rule does not consider datatypes that are platform dependant
2 participants