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

chore: remove panic for unimplemented trait dispatch #5329

Merged
merged 4 commits into from
Jun 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions compiler/noirc_frontend/src/hir/comptime/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
}
} else {
let name = self.interner.function_name(&function);
unreachable!("Non-builtin, lowlevel or oracle builtin fn '{name}'")

Check warning on line 115 in compiler/noirc_frontend/src/hir/comptime/interpreter.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (lowlevel)
}
}

Expand Down Expand Up @@ -609,10 +609,13 @@
let rhs = self.evaluate(infix.rhs)?;

// TODO: Need to account for operator overloading
assert!(
self.interner.get_selected_impl_for_expression(id).is_none(),
"Operator overloading is unimplemented in the interpreter"
);
// See https://github.com/noir-lang/noir/issues/4925
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved
if self.interner.get_selected_impl_for_expression(id).is_some() {
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved
return Err(InterpreterError::Unimplemented {
item: "Operator overloading is unimplemented in the interpreter. See https://github.com/noir-lang/noir/issues/4925".to_string(),
jfecher marked this conversation as resolved.
Show resolved Hide resolved
location: infix.operator.location,
});
}

use InterpreterError::InvalidValuesForBinary;
match infix.operator.kind {
Expand Down
Loading