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
{{ message }}
Repository navigation
Narrowing via assignment in switch broken by #35000 #35070
#35000 breaks activex-scripting on Definitely Typed because narrowing via assignment in switch no longer works:
typeO={a: number,b: number}typeK=keyofO|'c'functionf(o: O,k: K){switch(k){case'c':
k='a'}k==='c'// should have error herereturno[k]// and no error here}
Actual behavior:
No error on k === 'c' and error on o[k].
Using if (k === 'c') { instead of switch (k) { case 'c': works correctly.
Activity