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
typeObj={from: stringto: string}typeDir="from"|"to"constdir: Dir="to"asDir// the same for:// declare const dir: Dirdeclareconstobj: Objconstm: Obj={
...obj,[dir]: 1,// no error, but should be}// this is working as expcted:constdir2: Dir="to"constm2: Obj={
...obj,[dir2]: 1,// error as should be}
π Actual behavior
Should not allow arbitrary value.
π Expected behavior
Overlooks arbitrary value for type asserted property in object spread.