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
Throw in catch causes type narrowing in finally block #34797
functionf(){leta: number|null=null;try{a=123;returna;}catch(e){throwe;// remove line and error disappears}finally{console.log(a);// works fine, logs 123if(a!=null&&a.toFixed(0)=="123"){// Property 'toFixed' does not exist on type 'never'.(2339)}}}f();
Expected behavior: a should have type number | null in the finally block.
Actual behavior: a has type null in the finally block and narrowing with a != null it becoms never
Activity