diff --git a/midas/checker/midas.py b/midas/checker/midas.py index 750fb02..60d2b85 100644 --- a/midas/checker/midas.py +++ b/midas/checker/midas.py @@ -135,8 +135,7 @@ class MidasTyper(m.Stmt.Visitor[None], m.Expr.Visitor[Type], m.Type.Visitor[Type def assert_bool(self, expr: m.Expr): type: Type = self.type_of(expr) if not self.types.is_subtype(type, self._bool): - # TODO: change back to error when operations are type checked - self.reporter.warning(expr.location, f"Must be a boolean but is {type}") + self.reporter.error(expr.location, f"Must be a boolean but is {type}") def visit_type_stmt(self, stmt: m.TypeStmt) -> None: name: str = stmt.name.lexeme @@ -183,8 +182,7 @@ class MidasTyper(m.Stmt.Visitor[None], m.Expr.Visitor[Type], m.Type.Visitor[Type ] if not self._is_valid_predicate(type): - # TODO: change back to error when operations are type checked - self.reporter.warning( + self.reporter.error( stmt.body.location, f"Predicate function body must evaluate to a boolean, got {type}", )