error TS2344: Type ‘{ name: string; }‘ does not satisfy the constraint ‘{ age: number; }‘. Property ‘age‘ is missing in type ‘{ name: string; }‘ but required in type ‘{ age: number; }‘.
Broken Code ❌
1 2 3 4 5 6
function increaseAge<T extends { age: number }>(data: T): T { data.age += 1; return data; }