Why do subtypes need to be assigned to a variable before being used as a function argument?
It’s because when you use a “fresh” object literal (meaning one that hasn’t been assigned to a variable yet) in a place that expects a particular type, it’s often an error to add properties not mentioned in the type. So this is flagged as an error via excess property checking. It’s one of the few … Read more