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
letfoo=()=>{};// if you remove or change foo definition to not a function, bug disappearsletbar;// if you add type annotation here, bug disappearswhile(1)// if you remove while, bug disappearsbar=~foo(...bar);// if you remove unary or spread operator, bug disappears// bar = || foo(...bar); // though this is a syntax error, it produces stack overflow also
Expected behavior:
Should compile with error report for spreading undefined and/or leaving bar as implicit any
Actual behavior:
Prints Maximum call stack size exceeded.
Or if you run this script with ts-node:
I meant to use ts-node in order to get the compiler stack trace, because if I reproduce this bug without ts-node, i.e. with tsc I only get "Maximum call stack size exceeded." string printed to the terminal. So yes, you can reproduce this bug with tsc v3.0.1 +
And sorry for tsconfig-paths, those options were left from my production code where I detected this bug, they don't influence the bug.
TypeScript Version: 3.0.1+ (including [email protected])
Search Terms:
Code
Expected behavior:
Should compile with error report for spreading
undefined
and/or leavingbar
as implicitany
Actual behavior:
Prints
Maximum call stack size exceeded
.Or if you run this script with ts-node:
View ts-node stack trace
Playground Link:
This is weird, playground from typescriptlang.com seems to work well, but playground from typescript-play.js.org produces the stack overflow as it does locally in my terminal (Ubuntu 18.04.2 LTS). You may see the error for the second playground in your browser console.
Related Issues:
#25149 To some degree
The text was updated successfully, but these errors were encountered: