Skip to content

Commit

Permalink
fix: check for literal overflows in expressions (#2742)
Browse files Browse the repository at this point in the history
  • Loading branch information
guipublic authored Sep 18, 2023
1 parent 36dcd48 commit 4009f30
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/noirc_frontend/src/hir/type_check/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ impl<'interner> TypeChecker<'interner> {
HirExpression::Prefix(_) => self
.errors
.push(TypeCheckError::InvalidUnaryOp { kind: annotated_type.to_string(), span }),
HirExpression::Infix(expr) => {
self.lint_overflowing_uint(&expr.lhs, annotated_type);
self.lint_overflowing_uint(&expr.rhs, annotated_type);
}
_ => {}
}
}
Expand Down

0 comments on commit 4009f30

Please sign in to comment.