mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Merge pull request #7163 from Microsoft/cachePairs
do not make inferences with the same source\target pair multiple times
This commit is contained in:
@@ -6524,6 +6524,7 @@ namespace ts {
|
||||
let targetStack: Type[];
|
||||
let depth = 0;
|
||||
let inferiority = 0;
|
||||
const visited: Map<boolean> = {};
|
||||
inferFromTypes(source, target);
|
||||
|
||||
function isInProcess(source: Type, target: Type) {
|
||||
@@ -6653,6 +6654,12 @@ namespace ts {
|
||||
return;
|
||||
}
|
||||
|
||||
const key = source.id + "," + target.id;
|
||||
if (hasProperty(visited, key)) {
|
||||
return;
|
||||
}
|
||||
visited[key] = true;
|
||||
|
||||
if (depth === 0) {
|
||||
sourceStack = [];
|
||||
targetStack = [];
|
||||
|
||||
2
src/server/protocol.d.ts
vendored
2
src/server/protocol.d.ts
vendored
@@ -469,7 +469,7 @@ declare namespace ts.server.protocol {
|
||||
placeOpenBraceOnNewLineForControlBlocks?: boolean;
|
||||
|
||||
/** Index operator */
|
||||
[key: string]: string | number | boolean;
|
||||
[key: string]: string | number | boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user