From c4062c95950293e957cbd119c597b22dff73d283 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Tue, 16 Jun 2026 12:55:05 +0200 Subject: [PATCH] fix(checker): allow inferred return to be subtype of hint --- midas/checker/python.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/midas/checker/python.py b/midas/checker/python.py index 9af8e73..b4da4ba 100644 --- a/midas/checker/python.py +++ b/midas/checker/python.py @@ -252,7 +252,7 @@ class PythonTyper( if returns_hint is not None: assert stmt.returns is not None returns = returns_hint - if returns != inferred_return: + if not self.is_subtype(inferred_return, returns): self.reporter.error( stmt.returns.location, f"Return type mismatch, annotated {returns} but returns {inferred_return}",