Closed
Description
function f<T>(x: T) {
x = {};
}
Current
Type '{}' is not assignable to type 'T'.
'{}' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
Type '10' is not assignable to type 'T'.
'10' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.
Nobody ever mentioned a constraint or {}
in this code, so why is it being displayed? As a user, this is telling me more than I needed or wanted to know.
Proposed
Type '{}' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to '{}'.
Type '10' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to '10'.