do not make inferences with the same source\target pair multiple times

This commit is contained in:
Vladimir Matveev 2016-02-19 22:05:17 -08:00
parent 6b05ad7627
commit 517d7d983f

View File

@ -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 = [];