You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
address_1 in x should be optional with ? since in some cases it is deleted.
Typescript reports an error for this, however that doesn't mean that delete doesn't change the type.
e.g. if errors are ignored for this, the type will be wrong and lead to bugs downstream.
if errors are ignored for this, the type will be wrong and lead to bugs downstream.
I mean, this is true of pretty much all TS errors, since thatβs the entire point of the type checker. βIf you ts-ignore this error you might shoot yourself in the footβ isnβt really a good argument for changing the behavior.
π Search Terms
object delete TS2790 optional property
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?#code/FDBmFcDsGMBcEsD2kAEpGIBQoIYCcBzALhQCMMAbAUx1QEoUBvYFVlaZAZ1jXiooAmnFAF4mwAJASOUWHgCeJAOQ4lAGkkTuOWFWWqNU6PFiKUK9ZoAOibhwF7zBzTgEC8VTpwD6ARn2WEgC+ANwgbCjwoCiY+ASiImJy4FQMzBERDtS6vPxCAHSu7p4+vmERQeFsHJDcKAAeormCnGFBQA
π» Code
π Actual behavior
address_1
inx
is non-optionalπ Expected behavior
address_1
inx
should be optional with ? since in some cases it is deleted.Typescript reports an error for this, however that doesn't mean that
delete
doesn't change the type.e.g. if errors are ignored for this, the type will be wrong and lead to bugs downstream.
Additional information about the issue
Followup to #13783
The text was updated successfully, but these errors were encountered: