I thought this worked... what am I doing wrong?
interface State {
one: string;
two: number;
}
declare const key: keyof State;
declare const state: State;
const value = {
one: "",
two: 0
}[key]
state[key] = value;
// Type 'string | number' is not assignable to type 'never'.
// Type 'string' is not assignable to type 'never'.(2322)
I expected state[key] to be string | number not never