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: Prevent comparisons from being used on Fields #1860

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Jul 4, 2023

Description

Problem*

Adds missed checks to the type system to prevent comparison operators (other than == and !=) from being used on Fields even if at least 1 operand is a type variable. These are implemented the same way we prevent this with bitwise operators - with a delayed type check.

Resolves #1857

Summary*

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Collaborator

@ludamad ludamad left a comment

Choose a reason for hiding this comment

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

LGTM

@TomAFrench TomAFrench changed the title fix(type system): Prevent comparisons from being used on fields fix: Prevent comparisons from being used on fields Jul 5, 2023
@jfecher jfecher added this pull request to the merge queue Jul 5, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 5, 2023
@TomAFrench TomAFrench added this pull request to the merge queue Jul 5, 2023
@TomAFrench TomAFrench removed this pull request from the merge queue due to a manual request Jul 5, 2023
@TomAFrench TomAFrench changed the title fix: Prevent comparisons from being used on fields fix: Prevent comparisons from being used on Fields Jul 5, 2023
@TomAFrench TomAFrench enabled auto-merge July 5, 2023 11:38
@TomAFrench TomAFrench added this pull request to the merge queue Jul 5, 2023
Merged via the queue into master with commit c8858fd Jul 5, 2023
@TomAFrench TomAFrench deleted the jf/add-field-typechecks branch July 5, 2023 11:54
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.

Comparing a Field to a given integer (such as 0) should fail.
4 participants