-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE fix: fix curve parameters for bigints (noir-lang/noir#4900) chore: bump `rustls` to v0.21.11 (noir-lang/noir#4895) fix: Update noir-gates-diff commit to use master reference report (noir-lang/noir#4891) fix: Reset the noir-gates-diff report on master (noir-lang/noir#4878) fix(experimental): Skip over comptime functions in scan pass (noir-lang/noir#4893) chore(experimental): Improve variable not defined error message in comptime interpreter (noir-lang/noir#4889) chore(experimental): Add scan pass and `into_expression` for comptime interpreter (noir-lang/noir#4884) END_COMMIT_OVERRIDE --------- Co-authored-by: Tom French <[email protected]>
- Loading branch information
1 parent
56b4de6
commit b366be4
Showing
31 changed files
with
796 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
9704bd0abfe2dba1e7a4aef6cdb6cc83d70b929e | ||
5985e4285de9e29f7c986103a49fdaec59228887 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
noir/noir-repo/compiler/noirc_frontend/src/hir/comptime/errors.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
use crate::Type; | ||
use acvm::FieldElement; | ||
use noirc_errors::Location; | ||
|
||
use super::value::Value; | ||
|
||
/// The possible errors that can halt the interpreter. | ||
#[derive(Debug)] | ||
pub enum InterpreterError { | ||
ArgumentCountMismatch { expected: usize, actual: usize, call_location: Location }, | ||
TypeMismatch { expected: Type, value: Value, location: Location }, | ||
NonComptimeVarReferenced { name: String, location: Location }, | ||
IntegerOutOfRangeForType { value: FieldElement, typ: Type, location: Location }, | ||
ErrorNodeEncountered { location: Location }, | ||
NonFunctionCalled { value: Value, location: Location }, | ||
NonBoolUsedInIf { value: Value, location: Location }, | ||
NonBoolUsedInConstrain { value: Value, location: Location }, | ||
FailingConstraint { message: Option<Value>, location: Location }, | ||
NoMethodFound { object: Value, typ: Type, location: Location }, | ||
NonIntegerUsedInLoop { value: Value, location: Location }, | ||
NonPointerDereferenced { value: Value, location: Location }, | ||
NonTupleOrStructInMemberAccess { value: Value, location: Location }, | ||
NonArrayIndexed { value: Value, location: Location }, | ||
NonIntegerUsedAsIndex { value: Value, location: Location }, | ||
NonIntegerIntegerLiteral { typ: Type, location: Location }, | ||
NonIntegerArrayLength { typ: Type, location: Location }, | ||
NonNumericCasted { value: Value, location: Location }, | ||
IndexOutOfBounds { index: usize, length: usize, location: Location }, | ||
ExpectedStructToHaveField { value: Value, field_name: String, location: Location }, | ||
TypeUnsupported { typ: Type, location: Location }, | ||
InvalidValueForUnary { value: Value, operator: &'static str, location: Location }, | ||
InvalidValuesForBinary { lhs: Value, rhs: Value, operator: &'static str, location: Location }, | ||
CastToNonNumericType { typ: Type, location: Location }, | ||
QuoteInRuntimeCode { location: Location }, | ||
NonStructInConstructor { typ: Type, location: Location }, | ||
CannotInlineMacro { value: Value, location: Location }, | ||
UnquoteFoundDuringEvaluation { location: Location }, | ||
|
||
Unimplemented { item: &'static str, location: Location }, | ||
|
||
// Perhaps this should be unreachable! due to type checking also preventing this error? | ||
// Currently it and the Continue variant are the only interpreter errors without a Location field | ||
BreakNotInLoop { location: Location }, | ||
ContinueNotInLoop { location: Location }, | ||
|
||
// These cases are not errors, they are just used to prevent us from running more code | ||
// until the loop can be resumed properly. These cases will never be displayed to users. | ||
Break, | ||
Continue, | ||
} | ||
|
||
#[allow(unused)] | ||
pub(super) type IResult<T> = std::result::Result<T, InterpreterError>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.