mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
drop inference limit
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user