From 749efa1b828ecf32b857f53ad93781f349bb61bd Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Fri, 21 Feb 2025 20:07:21 +0000 Subject: [PATCH 1/2] Add one more type-checking pass --- mypy/checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/checker.py b/mypy/checker.py index 04a286beef5e..d6a870a1ea22 100644 --- a/mypy/checker.py +++ b/mypy/checker.py @@ -216,7 +216,7 @@ T = TypeVar("T") -DEFAULT_LAST_PASS: Final = 1 # Pass numbers start at 0 +DEFAULT_LAST_PASS: Final = 2 # Pass numbers start at 0 # Maximum length of fixed tuple types inferred when narrowing from variadic tuples. MAX_PRECISE_TUPLE_SIZE: Final = 8 From 4145d0cec83f27f18583faa23d9761da3c214787 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Fri, 21 Feb 2025 21:09:17 +0000 Subject: [PATCH 2/2] Update test --- test-data/unit/check-modules.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-data/unit/check-modules.test b/test-data/unit/check-modules.test index 87eb25a48cc2..000dae86131d 100644 --- a/test-data/unit/check-modules.test +++ b/test-data/unit/check-modules.test @@ -1388,14 +1388,14 @@ import b import b class C: def f1(self) -> None: - self.x2 + reveal_type(self.x2) def f2(self) -> None: self.x2 = b.b [file b.py] import a b = 1 + int() [out] -tmp/a.py:4: error: Cannot determine type of "x2" +tmp/a.py:4: note: Revealed type is "builtins.int" [case testErrorInPassTwo1] import b