Skip to content

Commit f00c1c6

Browse files
committed
fix crash when serializing a type-ignored property setter
This fixes the crash from python#3491. I wasn't able to reproduce the crash in a test, even with '# flags: --incremental', so I'm not adding any new tests. Do I need some special flags to make tests write the cache?
1 parent 9b172e6 commit f00c1c6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎mypy/semanal.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,10 @@ def analyze_property_with_multi_part_definition(self, defn: OverloadedFuncDef) -
564564
first_item.var.is_settable_property = True
565565
# Get abstractness from the original definition.
566566
item.func.is_abstract = first_item.func.is_abstract
567-
item.func.accept(self)
568567
else:
569568
self.fail("Decorated property not supported", item)
569+
if isinstance(item, Decorator):
570+
item.func.accept(self)
570571

571572
def analyze_function(self, defn: FuncItem) -> None:
572573
is_method = self.is_class_scope()

0 commit comments

Comments
 (0)