From 41dcf1ac5be5d1d9b46d20b97bae101e30735f44 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 --- 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 c29d686ce5d8..52b3121f9fb3 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -2705,8 +2705,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 1ef08f825e7a..6a5120159c2d 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