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
Inference of recursive arrow function's return type is any #58100
// const foo: () => anyconstfoo=()=>{if(Math.random()>0.5){returnfoo()}return0}// function bar(): numberfunctionbar(){if(Math.random()>0.5){returnbar()}return0}
🙁 Actual behavior
const foo: () => any
'foo' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
🙂 Expected behavior
The inference should be const foo: () => number, even this inference is happened before the arrow function assign to foo
Duplicate of #53978. Used search terms: recursive any in:title
They mention a pull request (#53995) related to regular function with self tail calls. Maybe I can update the title to "Self tail calls of arrow function were not ignored"?
Activity
MartinJohns commentedon Apr 7, 2024
Duplicate of #53978. Used search terms:
recursive any in:titlehospotho commentedon Apr 7, 2024
They mention a pull request (#53995) related to regular function with self tail calls. Maybe I can update the title to "Self tail calls of arrow function were not ignored"?