Closed
Description
TypeScript Version: 3.5.0-dev.20190507
Search Terms:
- index signature
- unknown
Code
export interface I {
foo(): { [key: string]: unknown };
}
export class B implements I {
foo(): object {
return {};
}
}
Expected behavior:
This code compiles without errors in TS 3.4.5
Actual behavior:
In 3.5@next, there is the error:
Property 'foo' in type 'B' is not assignable to the same property in base type 'I'.
Type '() => object' is not assignable to type '() => { [key: string]: unknown; }'.
Type 'object' is not assignable to type '{ [key: string]: unknown; }'.
Index signature is missing in type '{}'.
This may be by design but I'm not sure which issue tracks the change.
We hit this issue in the vscode codebase
Playground Link:
Related Issues: