Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher committed Sep 18, 2024
1 parent a4c98f5 commit 078408a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions compiler/noirc_frontend/src/hir/comptime/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ impl<'local, 'interner> Interpreter<'local, 'interner> {
// are inconsistencies or the type needs to be known.
let expected_type = self.elaborator.interner.id_type(id);
let actual_type = result.get_type();
self.unify(&actual_type, &expected_type, location)
self.unify(&actual_type, &expected_type, location);
}
Ok(result)
}
Expand All @@ -1323,12 +1323,10 @@ impl<'local, 'interner> Interpreter<'local, 'interner> {
// We need to swap out the elaborator's file since we may be
// in a different one currently, and it uses that for the error location.
let old_file = std::mem::replace(&mut self.elaborator.file, location.file);
self.elaborator.unify(actual, expected, || {
TypeCheckError::TypeMismatch {
expected_typ: expected.to_string(),
expr_typ: actual.to_string(),
expr_span: location.span,
}
self.elaborator.unify(actual, expected, || TypeCheckError::TypeMismatch {
expected_typ: expected.to_string(),
expr_typ: actual.to_string(),
expr_span: location.span,
});
self.elaborator.file = old_file;
}
Expand Down

0 comments on commit 078408a

Please sign in to comment.