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

Investigate whether kind check can be removed from evaluate_to_field_element #6260

Open
michaeljklein opened this issue Oct 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@michaeljklein
Copy link
Contributor

Problem

evaluate_to_field_element (from #6137) currently checks the kind of its input:

        if let Some((binding, binding_kind)) = self.get_inner_type_variable() {
            if let TypeBinding::Bound(binding) = &*binding.borrow() {
                if kind.unifies(&binding_kind) {
                    return binding.evaluate_to_field_element(&binding_kind);
                }
            }
        }

        match self.canonicalize() {
            Type::Constant(x, constant_kind) => {
                if kind.unifies(&constant_kind) {
...

Happy Case

After we've completed the rest of the issues related to Kind size checks, investigate whether we can remove the kind.unifies(..) checks from evaluate_to_field_element.

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

Nice-to-have

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@michaeljklein michaeljklein added the enhancement New feature or request label Oct 9, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Oct 9, 2024
michaeljklein added a commit that referenced this issue Oct 9, 2024
…p error handling in interpreter, replace warning message that 'size checks are being implemented for this case' with note that warning may become error, rephrase DownsizingCast message, split is_field_element into type-level and value-level versions (using type-level one for generic arithmetics), note #6260 on evaluate_to_field_element, use get_type for Type::Alias, used checked arithmetic in BinaryTypeOperator::function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant