Closed
Description
TypeScript Version: 3.9.1-rc, 4.0.0-dev.20200430
Search Terms: Array flat RangeError Maximum call stack size exceeded
Code
class Foo <T> {
arr: T[] = [];
bar (
depth = 1,
) {
return this.arr.flat(depth);
}
}
Expected behavior:
Code compiles without errors.
Actual behavior:
TSC crashes with RangeError: Maximum call stack size exceeded
. Edit: Only happens when either --watch
or --declaration
flag is set.
Playground Link: Couldn't figure out how to add newer libs for Array, and not super useful anyway, as the compiler crashes
Related Issues:
#32131 seems to be the breaking PR
#36554 seems related maybe
edit: simplified code example