From 778542b93a6f5b3c168a8acc03717700ae6f8048 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Sun, 4 Aug 2024 12:22:29 +0100 Subject: [PATCH] Revert "Fix `RawExpressionType.accept` crash with `--cache-fine-grained`" (#17637) Reverts python/mypy#17588 (cherry picked from commit 41dcf1ac5be5d1d9b46d20b97bae101e30735f44) --- mypy/types.py | 2 -- test-data/unit/check-typeddict.test | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/mypy/types.py b/mypy/types.py index 3dce98be6cf0..ada45112ebf5 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -2703,8 +2703,6 @@ def simple_name(self) -> str: return self.base_type_name.replace("builtins.", "") def accept(self, visitor: TypeVisitor[T]) -> T: - if self.node is not None: - return self.node.accept(visitor) assert isinstance(visitor, SyntheticTypeVisitor) ret: T = visitor.visit_raw_expression_type(self) return ret diff --git a/test-data/unit/check-typeddict.test b/test-data/unit/check-typeddict.test index a6a89f14309f..d35ec8ddd80e 100644 --- a/test-data/unit/check-typeddict.test +++ b/test-data/unit/check-typeddict.test @@ -1442,18 +1442,6 @@ reveal_type(x) # N: Revealed type is "TypedDict('__main__.X', {'a': TypedDict('_ reveal_type(x['a']['b']) # N: Revealed type is "builtins.int" [builtins fixtures/dict.pyi] -[case testTypedDictForwardReferenceCacheFineGrained] -# flags: --cache-fine-grained -from mypy_extensions import TypedDict -class A(TypedDict): - b: "B" -class B(TypedDict): - c: "C" -class C(TypedDict): - d: "D" -class D: - pass - [case testSelfRecursiveTypedDictInheriting] from mypy_extensions import TypedDict