Files
tsgo/testdata/baselines/reference/submodule/compiler/computedPropertyBindingElementDeclarationNoCrash1.errors.txt

26 lines
815 B
Plaintext

computedPropertyBindingElementDeclarationNoCrash1.ts(12,21): error TS2739: Type '{ [x: string]: unknown; }' is missing the following properties from type 'State': a, b
==== computedPropertyBindingElementDeclarationNoCrash1.ts (1 errors) ====
// https://github.com/microsoft/TypeScript/issues/61351
export type State = {
a: number;
b: string;
};
export class Test {
setState(state: State) {}
test = (e: any) => {
for (const [key, value] of Object.entries(e)) {
this.setState({
~
[key]: value,
~~~~~~~~~~~~~~~~~~~~~
});
~~~~~~~
!!! error TS2739: Type '{ [x: string]: unknown; }' is missing the following properties from type 'State': a, b
}
};
}