File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2237,11 +2237,11 @@ replace(None) # E: Value of type variable "_DataclassT" of "replace" cannot be
22372237from dataclasses import is_dataclass, replace
22382238
22392239def f(x: object) -> None:
2240- # error before type-guard
2241- y = replace (x) # E: Value of type variable "_DataclassT" of "replace" cannot be "object"
2242- # no error after type-guard
2243- if is_dataclass(x) and not isinstance(x, type):
2244- y = replace(x)
2240+ _ = replace(x) # E: Value of type variable "_DataclassT" of "replace" cannot be "object"
2241+ if is_dataclass (x):
2242+ _ = replace(x) # E: Value of type variable "_DataclassT" of "replace" cannot be "Union[DataclassInstance, Type[DataclassInstance]]"
2243+ if not isinstance(x, type):
2244+ _ = replace(x)
22452245
22462246[builtins fixtures/tuple.pyi]
22472247
You can’t perform that action at this time.
0 commit comments