File tree 1 file changed +5
-5
lines changed 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
2237
2237
from dataclasses import is_dataclass, replace
2238
2238
2239
2239
def 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)
2245
2245
2246
2246
[builtins fixtures/tuple.pyi]
2247
2247
You can’t perform that action at this time.
0 commit comments