Bug Report
🔎 Search Terms
recursive, types, typescript, javascript, function, promise
🕗 Version & Regression Information
Noticed bug last week.
- This is a crash
- This was tested on versions 4.6.2, 4.6.3 and nightly, and the bug occurs in all
⏯ Playground Link
Playground link with relevant code
💻 Code
type Bad = string | Promise<Bad> | () => Bad;
var original : Bad = () => 'hello';
let clone : Bad = () => {
return original();
}
🙁 Actual behavior
This causes the compiler to get stuck in an infinite computation, and it eventually crashes due to a stack overflow.
🙂 Expected behavior
The compiler to correctly read the type of clone without a crash. If Promise<Bad> is removed from the definition of Bad then the bug no longer persists and the expected behaviour occurs.
Bug Report
🔎 Search Terms
recursive, types, typescript, javascript, function, promise
🕗 Version & Regression Information
Noticed bug last week.
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
This causes the compiler to get stuck in an infinite computation, and it eventually crashes due to a stack overflow.
🙂 Expected behavior
The compiler to correctly read the type of
clonewithout a crash. IfPromise<Bad>is removed from the definition ofBadthen the bug no longer persists and the expected behaviour occurs.