Skip to content

Commit 4af8bb2

Browse files
committed
fix merge errors
1 parent 55430f1 commit 4af8bb2

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

mypy/checker.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2817,10 +2817,8 @@ def check_enum(self, defn: ClassDef) -> None:
28172817
self.check_enum_new(defn)
28182818

28192819
def check_final_enum(self, defn: ClassDef, base: TypeInfo) -> None:
2820-
for sym in base.names.values():
2821-
if self.is_final_enum_value(sym):
2822-
self.fail(f'Cannot extend enum with existing members: "{base.name}"', defn)
2823-
break
2820+
if base.enum_members:
2821+
self.fail(f'Cannot extend enum with existing members: "{base.name}"', defn)
28242822

28252823
def is_final_enum_value(self, sym: SymbolTableNode, base: TypeInfo) -> bool:
28262824
if isinstance(sym.node, (FuncBase, Decorator)):
@@ -3547,10 +3545,8 @@ def check_compatibility_all_supers(self, lvalue: RefExpr, rvalue: Expression) ->
35473545
):
35483546
continue
35493547

3550-
if is_private(lvalue_node.name):
3551-
continue
3552-
3553-
base_type, base_node = self.lvalue_type_from_base(lvalue_node, base)
3548+
base_type, base_node = self.node_type_from_base(lvalue_node.name, base, lvalue)
3549+
# TODO: if the r.h.s. is a descriptor, we should check setter override as well.
35543550
custom_setter = is_custom_settable_property(base_node)
35553551
if isinstance(base_type, PartialType):
35563552
base_type = None

test-data/unit/pythoneval.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,7 @@ replace(b, x="egg", y=42)
19821982
replace(b, x=42, y="egg", q=42)
19831983
[out]
19841984
_testDataclassReplace.py:4: note: "replace" of "A" defined here
1985+
_testDataclassReplace.py:8: note: "replace" of "B" defined here
19851986
_testDataclassReplace.py:13: note: Revealed type is "_testDataclassReplace.A"
19861987
_testDataclassReplace.py:14: error: Too few arguments for "replace"
19871988
_testDataclassReplace.py:15: error: Argument "x" to "replace" of "A" has incompatible type "str"; expected "int"

0 commit comments

Comments
 (0)