You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interfaceIState{smth: string;}letstate: IState={smth: ''};functionupdate(callback: (state: IState)=>IState): void{state=callback(state);}// no error here for wrong fieldupdate(state=>({ ...state,smth2: ''}));// and here tooupdate(state=>({smth: '',smth2: ''}));// this will mark an errorupdate(state=>{state={ ...state,smth2: ''};returnstate;});
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.7.1
Code
Expected behavior:
Mark an error for wrong field
Actual behavior:
No error for wrong field
Playground Link:
https://stackblitz.com/edit/typescript-callback-return-type-error?file=index.ts
The text was updated successfully, but these errors were encountered: