export interface DemoAttr<T> {
attr: Demo<T>
a: boolean
b: string
}
export class Demo<T> implements DemoAttr<T>{
attr = {} as Demo<T>
a = false
b = ''
setAttr(key: keyof DemoAttr<T>, value: DemoAttr<T>[keyof DemoAttr<T>]) {
// how to fix it? and why?
// I use `any` to replace the value type is not work either
this.attr[key] = value
}
}
I just wonder to know what reason causes this error, any why even use any can not fix it either?
and if I remove the b attribute and use any as value type then it works well.