TypeScript/tests/cases/compiler/errorElaborationDivesIntoApparentlyPresentPropsOnly.ts
2018-11-06 12:51:11 -08:00

12 lines
237 B
TypeScript

function foo<T extends { a: string }>(x: T) {
x = { a: "abc", b: 20, c: 30 };
}
function bar<T extends { a: string }>(x: T) {
x = { a: 20 };
}
function baz<T extends { a: string }>(x: T) {
x = { a: "not ok" };
}