drop inference limit

This commit is contained in:
Vladimir Matveev
2016-03-21 15:15:41 -07:00
parent 8514d0d5eb
commit 6f37d31e18
5 changed files with 347 additions and 6 deletions

View File

@@ -6673,7 +6673,6 @@ namespace ts {
function inferTypes(context: InferenceContext, source: Type, target: Type) {
let sourceStack: Type[];
let targetStack: Type[];
const maxDepth = 5;
let depth = 0;
let inferiority = 0;
const visited: Map<boolean> = {};
@@ -6802,11 +6801,6 @@ namespace ts {
if (isInProcess(source, target)) {
return;
}
// we delibirately limit the depth we examine to infer types: this speeds up the overall inference process
// and user rarely expects inferences to be made from the deeply nested constituents.
if (depth > maxDepth) {
return;
}
if (isDeeplyNestedGeneric(source, sourceStack, depth) && isDeeplyNestedGeneric(target, targetStack, depth)) {
return;
}