Call isDeeplyNestedType only when something changed
This commit is contained in:
parent
4f5361ab60
commit
f528318a82
|
@ -18714,13 +18714,13 @@ namespace ts {
|
||||||
if (recursionFlags & RecursionFlags.Source) {
|
if (recursionFlags & RecursionFlags.Source) {
|
||||||
(sourceStack || (sourceStack = []))[sourceDepth] = source;
|
(sourceStack || (sourceStack = []))[sourceDepth] = source;
|
||||||
sourceDepth++;
|
sourceDepth++;
|
||||||
|
if (!(expandingFlags & ExpandingFlags.Source) && isDeeplyNestedType(source, sourceStack, sourceDepth)) expandingFlags |= ExpandingFlags.Source;
|
||||||
}
|
}
|
||||||
if (recursionFlags & RecursionFlags.Target) {
|
if (recursionFlags & RecursionFlags.Target) {
|
||||||
(targetStack || (targetStack = []))[targetDepth] = target;
|
(targetStack || (targetStack = []))[targetDepth] = target;
|
||||||
targetDepth++;
|
targetDepth++;
|
||||||
|
if (!(expandingFlags & ExpandingFlags.Target) && isDeeplyNestedType(target, targetStack, targetDepth)) expandingFlags |= ExpandingFlags.Target;
|
||||||
}
|
}
|
||||||
if (!(expandingFlags & ExpandingFlags.Source) && isDeeplyNestedType(source, sourceStack, sourceDepth)) expandingFlags |= ExpandingFlags.Source;
|
|
||||||
if (!(expandingFlags & ExpandingFlags.Target) && isDeeplyNestedType(target, targetStack, targetDepth)) expandingFlags |= ExpandingFlags.Target;
|
|
||||||
if (expandingFlags !== ExpandingFlags.Both) {
|
if (expandingFlags !== ExpandingFlags.Both) {
|
||||||
tracing?.push(tracing.Phase.CheckTypes, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
|
tracing?.push(tracing.Phase.CheckTypes, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
|
||||||
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
|
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
|
||||||
|
|
Loading…
Reference in a new issue