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
interfaceT{str: string;bool: boolean;}constinitState: T={str: 'date',bool: true,};letk: keyofT;initState[k]='test'asany;// ~~~~~~~~~~~~ Type 'any' is not assignable to type 'never'.ts(2322)
This seems to happen specifically with boolean properties. If I get rid of the boolean-valued property from the interface it works fine. If I have a larger interface and select non-boolean properties, it also works fine. But boolean and another type produces this error.
This error happens with TS 3.5 but not 3.4 (see playground link).