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
Unexpected type narrowing in finally block with return in both try and catch block #35644
constmain=()=>{lethoge: string|undefined=undefined;try{hoge='hoge!';return;// Bug disappears after removing this return.}catch{return;// Bug disappears after removing this return.}finally{if(hoge){hoge.length;}return;}}main();
Expected behavior:
In finally block, hoge's type is string | undefined
Actual behavior:
In finally block, hoge's type is only undefined, and Property 'length' does not exist on type 'never'. error occured.
Activity