Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion compiler/noirc_frontend/src/elaborator/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl<'context> Elaborator<'context> {

/// Equivalent to `elaborate_pattern`, this version just also
/// adds any new DefinitionIds that were created to the given Vec.
pub(super) fn elaborate_pattern_and_store_ids(
pub fn elaborate_pattern_and_store_ids(
&mut self,
pattern: Pattern,
expected_type: Type,
Expand Down
11 changes: 11 additions & 0 deletions compiler/noirc_frontend/src/hir/comptime/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ pub enum InterpreterError {
FailedToResolveTraitDefinition {
location: Location,
},
FunctionAlreadyResolved {
location: Location,
},

Unimplemented {
item: String,
Expand Down Expand Up @@ -255,6 +258,7 @@ impl InterpreterError {
| InterpreterError::TraitDefinitionMustBeAPath { location }
| InterpreterError::FailedToResolveTraitDefinition { location }
| InterpreterError::FailedToResolveTraitBound { location, .. } => *location,
InterpreterError::FunctionAlreadyResolved { location, .. } => *location,

InterpreterError::FailedToParseMacro { error, file, .. } => {
Location::new(error.span(), *file)
Expand Down Expand Up @@ -516,6 +520,13 @@ impl<'a> From<&'a InterpreterError> for CustomDiagnostic {
let msg = "Failed to resolve to a trait definition".to_string();
CustomDiagnostic::simple_error(msg, String::new(), location.span)
}
InterpreterError::FunctionAlreadyResolved { location } => {
let msg = "Function already resolved".to_string();
let secondary =
"The function was previously called at compile-time or is in another crate"
.to_string();
CustomDiagnostic::simple_error(msg, secondary, location.span)
}
}
}
}
Loading