Closed
Description
TypeScript Version: master
Code
- In es5.d.ts, add
this: this
parameters to all Array methods - Run inferringAnyFunctionType2 (reproduced below)
function f<T extends [(p1: number) => number]>(p: T): T {
return p;
}
var v = f([x => x]);
Expected behavior:
The test passes
Actual behavior:
TypeScript runs out of memory.
It looks as if something about instantiating this
types in a constraint evades the relation cache and keeps instantiating types. This might have something to do with the special handling of arrays and tuples, because I can't get the failure to repro when switching to a non built-in type.