From a4f5db7ece72f6d58b8d4dae849a7f2b06fa4259 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Tue, 9 Jun 2026 08:05:31 +0200 Subject: [PATCH] fix(checker): use reduce_types to infer return type --- midas/checker/python.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/midas/checker/python.py b/midas/checker/python.py index 84963bb..59f6881 100644 --- a/midas/checker/python.py +++ b/midas/checker/python.py @@ -204,13 +204,13 @@ class PythonTyper( inferred_return: Type = UnknownType() if not returned: env.return_types.append(UnitType()) - return_types: set[Type] = set(env.return_types) + return_types: list[Type] = self.types.reduce_types(env.return_types) if len(return_types) == 1: - inferred_return = list(return_types)[0] + inferred_return = return_types[0] elif len(return_types) > 1: self.reporter.error( stmt.location, - f"Mixed return types: {env.return_types}", + f"Mixed return types: {return_types}", ) returns: Type = UnknownType()