Skip to content

Commit

Permalink
fix typecheck err formatting in instantiate
Browse files Browse the repository at this point in the history
  • Loading branch information
vezenovm committed May 23, 2024
1 parent c9192f5 commit 8c1e8d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
3 changes: 2 additions & 1 deletion compiler/noirc_frontend/src/elaborator/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ impl<'context> Elaborator<'context> {
self.interner,
);

let func_type = self.type_check_variable(function_name, function_id, turbofish_generics);
let func_type =
self.type_check_variable(function_name, function_id, turbofish_generics);

// Type check the new call now that it has been changed from a method call
// to a function call. This way we avoid duplicating code.
Expand Down
16 changes: 6 additions & 10 deletions compiler/noirc_frontend/src/elaborator/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,16 +486,12 @@ impl<'context> Elaborator<'context> {
match turbofish_generics {
Some(turbofish_generics) => {
if turbofish_generics.len() != function_generic_count {
self.errors.push((
CompilationError::TypeError(
TypeCheckError::IncorrectTurbofishGenericCount {
expected_count: function_generic_count,
actual_count: turbofish_generics.len(),
span,
},
),
location.file,
));
let type_check_err = TypeCheckError::IncorrectTurbofishGenericCount {
expected_count: function_generic_count,
actual_count: turbofish_generics.len(),
span,
};
self.errors.push((CompilationError::TypeError(type_check_err), location.file));
typ.instantiate_with_bindings(bindings, self.interner)
} else {
// Fetch the count of any implicit generics on the function, such as
Expand Down

0 comments on commit 8c1e8d8

Please sign in to comment.