Closed
Description
TypeScript Version: 2.2.1 / nightly (2.3.0)
I believe my issue can be narrowed down:
export interface Params {
[name: string]: string
}
function doSmth(params: Params) { }
interface MyParams {
prop: string
}
let myParams: MyParams = { prop: 'X' }
let params: Params = myParams // NOT OK
Actual behavior:
Type 'MyParams' is not assignable to type 'Params'.
Index signature is missing in type 'MyParams'.
if to replace interface
with type
there is no error:
type MyParams = {
prop: string
}