Open KotlinIsland opened 1 day ago
it's an issue with type(
and unsafe constructors
so it's an issue with type
, but the impl of the generated __replace__
does something like that (return self.__class__(**changes)
)
so this is still unsafe and inventing a new type
won't make this error go away
it's actually an issue with the generated types for __replace__
being invalid subtypes
upstream issue: https://github.com/microsoft/pyright/issues/9351
also dataclasses.replace
is completely untyped anyway
mypy generates it with a monomorphic return type, so this error is picked up
it's an issue with the generated types for
__replace__
being invalid subtypes to repro this withoutdataclasses
would require usingReadOnly
to get the same behavior as afrozen
dataclass
: