From 2a7aac69ed98a66550d52b864b199dd00366297e Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Fri, 19 Jun 2026 14:41:43 +0200 Subject: [PATCH] fix(checker): change some diagnostics to warnings temporarily change type errors in predicates to warnings until operations are fully type checked --- midas/checker/midas.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/midas/checker/midas.py b/midas/checker/midas.py index 0fc4fb4..1ffe29d 100644 --- a/midas/checker/midas.py +++ b/midas/checker/midas.py @@ -101,7 +101,8 @@ 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): - self.reporter.error(expr.location, f"Must be a boolean but is {type}") + # TODO: change back to error when operations are type checked + self.reporter.warning(expr.location, f"Must be a boolean but is {type}") def visit_type_stmt(self, stmt: m.TypeStmt) -> None: name: str = stmt.name.lexeme @@ -148,7 +149,8 @@ class MidasTyper(m.Stmt.Visitor[None], m.Expr.Visitor[Type], m.Type.Visitor[Type ] if not self._is_valid_predicate(type): - self.reporter.error( + # TODO: change back to error when operations are type checked + self.reporter.warning( stmt.body.location, f"Predicate function body must evaluate to a boolean, got {type}", )