Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Compiler runs out of memory when this types are added to Array<T> methods #9707

Copy link
Copy link
@sandersn

Description

@sandersn
Issue body actions

TypeScript Version: master

Code

  1. In es5.d.ts, add this: this parameters to all Array methods
  2. 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.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.