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
interfaceIdx{[key: string]: number;}interfaceObj{idx?: Idx;}constl: Obj={};l.idx={};// WorksinterfaceFn{(): void;idx?: Idx;}constfn: Fn=()=>{};// Error: `{}` not assignable to `Idx`fn.idx={};
Expected behavior:
No error.
Actual behavior:
src/a.ts:15:7 - error TS2322: Type '{ (): void; idx: {}; }' is not assignable to type 'Fn'.
Types of property 'idx' are incompatible.
Type '{}' is not assignable to type 'Idx'.
Index signature is missing in type '{}'.
Discovered in koa-morgan on DefinitelyTyped. Probably due to #26368.
TypeScript Version: 3.1.0-dev.20180823
Code
Expected behavior:
No error.
Actual behavior:
Discovered in
koa-morganon DefinitelyTyped. Probably due to #26368.