Skip to content

Commit 99a0b36

Browse files
committed
Allows PlaceholderNode objects before raising an error for the attempted reuse of a member name inside an Enum.
1 parent 6c1eb5b commit 99a0b36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/semanal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2871,7 +2871,7 @@ def analyze_name_lvalue(self,
28712871
outer = self.is_global_or_nonlocal(name)
28722872
if kind == MDEF and isinstance(self.type, TypeInfo) and self.type.is_enum:
28732873
# Special case: we need to be sure that `Enum` keys are unique.
2874-
if existing:
2874+
if existing is not None and not isinstance(existing.node, PlaceholderNode):
28752875
self.fail('Attempted to reuse member name "{}" in Enum definition "{}"'.format(
28762876
name, self.type.name,
28772877
), lvalue)

0 commit comments

Comments
 (0)