@typescript-deploys/pr-build 5.5.0-pr-57973-2 → 5.5.0-pr-57989-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +208 -169
- package/lib/typescript.js +208 -169
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240328`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -42682,17 +42682,23 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
|
|
|
42682
42682
|
if (sourceIsInternal && !targetIsInternal || !sourceIsInternal && targetIsInternal) {
|
|
42683
42683
|
return maybeNonRelative;
|
|
42684
42684
|
}
|
|
42685
|
-
|
|
42686
|
-
|
|
42687
|
-
|
|
42688
|
-
|
|
42689
|
-
if (nearestSourcePackageJson !== nearestTargetPackageJson) {
|
|
42685
|
+
const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath));
|
|
42686
|
+
const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);
|
|
42687
|
+
const ignoreCase = !hostUsesCaseSensitiveFileNames(host);
|
|
42688
|
+
if (!packageJsonPathsAreEqual(nearestTargetPackageJson, nearestSourcePackageJson, ignoreCase)) {
|
|
42690
42689
|
return maybeNonRelative;
|
|
42691
42690
|
}
|
|
42692
42691
|
return relativePath;
|
|
42693
42692
|
}
|
|
42694
42693
|
return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative;
|
|
42695
42694
|
}
|
|
42695
|
+
function packageJsonPathsAreEqual(a, b, ignoreCase) {
|
|
42696
|
+
if (a === b)
|
|
42697
|
+
return true;
|
|
42698
|
+
if (a === void 0 || b === void 0)
|
|
42699
|
+
return false;
|
|
42700
|
+
return comparePaths(a, b, ignoreCase) === 0 /* EqualTo */;
|
|
42701
|
+
}
|
|
42696
42702
|
function countPathComponents(path) {
|
|
42697
42703
|
let count = 0;
|
|
42698
42704
|
for (let i = startsWith(path, "./") ? 2 : 0; i < path.length; i++) {
|
|
@@ -47971,6 +47977,7 @@ function createTypeChecker(host) {
|
|
|
47971
47977
|
void 0,
|
|
47972
47978
|
addUndefined
|
|
47973
47979
|
)),
|
|
47980
|
+
serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => serializeReturnTypeForSignature(context, signature)),
|
|
47974
47981
|
indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => indexInfoToIndexSignatureDeclarationHelper(
|
|
47975
47982
|
indexInfo,
|
|
47976
47983
|
context,
|
|
@@ -49055,9 +49062,8 @@ function createTypeChecker(host) {
|
|
|
49055
49062
|
}
|
|
49056
49063
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
49057
49064
|
var _a;
|
|
49058
|
-
const
|
|
49059
|
-
|
|
49060
|
-
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
49065
|
+
const flags = context.flags;
|
|
49066
|
+
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
49061
49067
|
context.approximateLength += 3;
|
|
49062
49068
|
let typeParameters;
|
|
49063
49069
|
let typeArguments;
|
|
@@ -49138,22 +49144,12 @@ function createTypeChecker(host) {
|
|
|
49138
49144
|
if (thisParameter) {
|
|
49139
49145
|
parameters.unshift(thisParameter);
|
|
49140
49146
|
}
|
|
49141
|
-
|
|
49142
|
-
const
|
|
49143
|
-
if (typePredicate) {
|
|
49144
|
-
returnTypeNode = typePredicateToTypePredicateNodeHelper(typePredicate, context);
|
|
49145
|
-
} else {
|
|
49146
|
-
const returnType = getReturnTypeOfSignature(signature);
|
|
49147
|
-
if (returnType && !(suppressAny && isTypeAny(returnType))) {
|
|
49148
|
-
returnTypeNode = serializeReturnTypeForSignature(context, returnType, signature, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports);
|
|
49149
|
-
} else if (!suppressAny) {
|
|
49150
|
-
returnTypeNode = factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
49151
|
-
}
|
|
49152
|
-
}
|
|
49147
|
+
context.flags = flags;
|
|
49148
|
+
const returnTypeNode = serializeReturnTypeForSignature(context, signature, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports);
|
|
49153
49149
|
let modifiers = options == null ? void 0 : options.modifiers;
|
|
49154
49150
|
if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
|
|
49155
|
-
const
|
|
49156
|
-
modifiers = factory.createModifiersFromModifierFlags(
|
|
49151
|
+
const flags2 = modifiersToFlags(modifiers);
|
|
49152
|
+
modifiers = factory.createModifiersFromModifierFlags(flags2 | 64 /* Abstract */);
|
|
49157
49153
|
}
|
|
49158
49154
|
const node = kind === 179 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 180 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 173 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodDeclaration */ ? factory.createMethodDeclaration(
|
|
49159
49155
|
modifiers,
|
|
@@ -49897,7 +49893,24 @@ function createTypeChecker(host) {
|
|
|
49897
49893
|
}
|
|
49898
49894
|
return false;
|
|
49899
49895
|
}
|
|
49900
|
-
function serializeReturnTypeForSignature(context,
|
|
49896
|
+
function serializeReturnTypeForSignature(context, signature, includePrivateSymbol, bundled) {
|
|
49897
|
+
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
49898
|
+
const flags = context.flags;
|
|
49899
|
+
if (suppressAny)
|
|
49900
|
+
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
49901
|
+
let returnTypeNode;
|
|
49902
|
+
const returnType = getReturnTypeOfSignature(signature);
|
|
49903
|
+
if (returnType && !(suppressAny && isTypeAny(returnType))) {
|
|
49904
|
+
returnTypeNode = serializeReturnTypeForSignatureWorker(context, signature, includePrivateSymbol, bundled);
|
|
49905
|
+
} else if (!suppressAny) {
|
|
49906
|
+
returnTypeNode = factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
49907
|
+
}
|
|
49908
|
+
context.flags = flags;
|
|
49909
|
+
return returnTypeNode;
|
|
49910
|
+
}
|
|
49911
|
+
function serializeReturnTypeForSignatureWorker(context, signature, includePrivateSymbol, bundled) {
|
|
49912
|
+
const typePredicate = getTypePredicateOfSignature(signature);
|
|
49913
|
+
const type = getReturnTypeOfSignature(signature);
|
|
49901
49914
|
if (!isErrorType(type) && context.enclosingDeclaration) {
|
|
49902
49915
|
const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
|
49903
49916
|
const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
|
|
@@ -49910,7 +49923,11 @@ function createTypeChecker(host) {
|
|
|
49910
49923
|
}
|
|
49911
49924
|
}
|
|
49912
49925
|
}
|
|
49913
|
-
|
|
49926
|
+
if (typePredicate) {
|
|
49927
|
+
return typePredicateToTypePredicateNodeHelper(typePredicate, context);
|
|
49928
|
+
}
|
|
49929
|
+
const expr = signature.declaration && getPossibleTypeNodeReuseExpression(signature.declaration);
|
|
49930
|
+
return expressionOrTypeToTypeNode(context, expr, type);
|
|
49914
49931
|
}
|
|
49915
49932
|
function trackExistingEntityName(node, context, includePrivateSymbol) {
|
|
49916
49933
|
let introducesError = false;
|
|
@@ -50075,30 +50092,24 @@ function createTypeChecker(host) {
|
|
|
50075
50092
|
node.isTypeOf
|
|
50076
50093
|
);
|
|
50077
50094
|
}
|
|
50078
|
-
if (
|
|
50079
|
-
|
|
50080
|
-
return factory.updateParameterDeclaration(
|
|
50081
|
-
node,
|
|
50082
|
-
/*modifiers*/
|
|
50083
|
-
void 0,
|
|
50084
|
-
node.dotDotDotToken,
|
|
50085
|
-
visitEachChild(
|
|
50086
|
-
node.name,
|
|
50087
|
-
visitExistingNodeTreeSymbols,
|
|
50088
|
-
/*context*/
|
|
50089
|
-
void 0
|
|
50090
|
-
),
|
|
50091
|
-
node.questionToken,
|
|
50092
|
-
factory.createKeywordTypeNode(133 /* AnyKeyword */),
|
|
50093
|
-
/*initializer*/
|
|
50094
|
-
void 0
|
|
50095
|
-
);
|
|
50096
|
-
}
|
|
50095
|
+
if (isNamedDeclaration(node) && node.name.kind === 167 /* ComputedPropertyName */ && !isLateBindableName(node.name)) {
|
|
50096
|
+
return void 0;
|
|
50097
50097
|
}
|
|
50098
|
-
if (isPropertySignature(node)) {
|
|
50099
|
-
|
|
50100
|
-
|
|
50098
|
+
if (isFunctionLike(node) && !node.type || isPropertyDeclaration(node) && !node.type && !node.initializer || isPropertySignature(node) && !node.type && !node.initializer || isParameter(node) && !node.type && !node.initializer) {
|
|
50099
|
+
let visited = visitEachChild(
|
|
50100
|
+
node,
|
|
50101
|
+
visitExistingNodeTreeSymbols,
|
|
50102
|
+
/*context*/
|
|
50103
|
+
void 0
|
|
50104
|
+
);
|
|
50105
|
+
if (visited === node) {
|
|
50106
|
+
visited = setTextRange(factory.cloneNode(node), node);
|
|
50101
50107
|
}
|
|
50108
|
+
visited.type = factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
50109
|
+
if (isParameter(node)) {
|
|
50110
|
+
visited.modifiers = void 0;
|
|
50111
|
+
}
|
|
50112
|
+
return visited;
|
|
50102
50113
|
}
|
|
50103
50114
|
if (isEntityName(node) || isEntityNameExpression(node)) {
|
|
50104
50115
|
const { introducesError, node: result } = trackExistingEntityName(node, context, includePrivateSymbol);
|
|
@@ -54797,11 +54808,15 @@ function createTypeChecker(host) {
|
|
|
54797
54808
|
const modifiers = getMappedTypeModifiers(type);
|
|
54798
54809
|
return modifiers & 8 /* ExcludeOptional */ ? -1 : modifiers & 4 /* IncludeOptional */ ? 1 : 0;
|
|
54799
54810
|
}
|
|
54800
|
-
function getModifiersTypeOptionality(type) {
|
|
54801
|
-
return type.flags & 2097152 /* Intersection */ ? Math.max(...map(type.types, getModifiersTypeOptionality)) : getObjectFlags(type) & 32 /* Mapped */ ? getCombinedMappedTypeOptionality(type) : 0;
|
|
54802
|
-
}
|
|
54803
54811
|
function getCombinedMappedTypeOptionality(type) {
|
|
54804
|
-
|
|
54812
|
+
if (getObjectFlags(type) & 32 /* Mapped */) {
|
|
54813
|
+
return getMappedTypeOptionality(type) || getCombinedMappedTypeOptionality(getModifiersTypeFromMappedType(type));
|
|
54814
|
+
}
|
|
54815
|
+
if (type.flags & 2097152 /* Intersection */) {
|
|
54816
|
+
const optionality = getCombinedMappedTypeOptionality(type.types[0]);
|
|
54817
|
+
return every(type.types, (t, i) => i === 0 || getCombinedMappedTypeOptionality(t) === optionality) ? optionality : 0;
|
|
54818
|
+
}
|
|
54819
|
+
return 0;
|
|
54805
54820
|
}
|
|
54806
54821
|
function isPartialMappedType(type) {
|
|
54807
54822
|
return !!(getObjectFlags(type) & 32 /* Mapped */ && getMappedTypeModifiers(type) & 4 /* IncludeOptional */);
|
|
@@ -58610,13 +58625,18 @@ function createTypeChecker(host) {
|
|
|
58610
58625
|
const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]);
|
|
58611
58626
|
const templateMapper = combineTypeMappers(objectType.mapper, mapper);
|
|
58612
58627
|
const instantiatedTemplateType = instantiateType(getTemplateTypeFromMappedType(objectType.target || objectType), templateMapper);
|
|
58628
|
+
const isOptional = getMappedTypeOptionality(objectType) > 0 || (isGenericType(objectType) ? getCombinedMappedTypeOptionality(getModifiersTypeFromMappedType(objectType)) > 0 : couldAccessOptionalProperty(objectType, index));
|
|
58613
58629
|
return addOptionality(
|
|
58614
58630
|
instantiatedTemplateType,
|
|
58615
58631
|
/*isProperty*/
|
|
58616
58632
|
true,
|
|
58617
|
-
|
|
58633
|
+
isOptional
|
|
58618
58634
|
);
|
|
58619
58635
|
}
|
|
58636
|
+
function couldAccessOptionalProperty(objectType, indexType) {
|
|
58637
|
+
const indexConstraint = getBaseConstraintOfType(indexType);
|
|
58638
|
+
return !!indexConstraint && some(getPropertiesOfType(objectType), (p) => !!(p.flags & 16777216 /* Optional */) && isTypeAssignableTo(getLiteralTypeFromProperty(p, 8576 /* StringOrNumberLiteralOrUnique */), indexConstraint));
|
|
58639
|
+
}
|
|
58620
58640
|
function getIndexedAccessType(objectType, indexType, accessFlags = 0 /* None */, accessNode, aliasSymbol, aliasTypeArguments) {
|
|
58621
58641
|
return getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType);
|
|
58622
58642
|
}
|
|
@@ -60945,6 +60965,7 @@ function createTypeChecker(host) {
|
|
|
60945
60965
|
const result = isRelatedTo(
|
|
60946
60966
|
source,
|
|
60947
60967
|
target,
|
|
60968
|
+
0 /* None */,
|
|
60948
60969
|
3 /* Both */,
|
|
60949
60970
|
/*reportErrors*/
|
|
60950
60971
|
!!errorNode,
|
|
@@ -61228,10 +61249,7 @@ function createTypeChecker(host) {
|
|
|
61228
61249
|
}
|
|
61229
61250
|
return true;
|
|
61230
61251
|
}
|
|
61231
|
-
function
|
|
61232
|
-
return isRelatedTo(source2, target2, 3 /* Both */, reportErrors2);
|
|
61233
|
-
}
|
|
61234
|
-
function isRelatedTo(originalSource, originalTarget, recursionFlags = 3 /* Both */, reportErrors2 = false, headMessage2, intersectionState = 0 /* None */) {
|
|
61252
|
+
function isRelatedTo(originalSource, originalTarget, intersectionState, recursionFlags = 3 /* Both */, reportErrors2 = false, headMessage2) {
|
|
61235
61253
|
if (originalSource === originalTarget)
|
|
61236
61254
|
return -1 /* True */;
|
|
61237
61255
|
if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 402784252 /* Primitive */) {
|
|
@@ -61291,7 +61309,7 @@ function createTypeChecker(host) {
|
|
|
61291
61309
|
if (source2.flags & 469499904 /* StructuredOrInstantiable */ || target2.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
61292
61310
|
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */);
|
|
61293
61311
|
if (isPerformingExcessPropertyChecks) {
|
|
61294
|
-
if (hasExcessProperties(source2, target2, reportErrors2)) {
|
|
61312
|
+
if (hasExcessProperties(source2, target2, reportErrors2, intersectionState)) {
|
|
61295
61313
|
if (reportErrors2) {
|
|
61296
61314
|
reportRelationError(headMessage2, source2, originalTarget.aliasSymbol ? originalTarget : target2);
|
|
61297
61315
|
}
|
|
@@ -61309,12 +61327,14 @@ function createTypeChecker(host) {
|
|
|
61309
61327
|
if (calls.length > 0 && isRelatedTo(
|
|
61310
61328
|
getReturnTypeOfSignature(calls[0]),
|
|
61311
61329
|
target2,
|
|
61330
|
+
intersectionState,
|
|
61312
61331
|
1 /* Source */,
|
|
61313
61332
|
/*reportErrors*/
|
|
61314
61333
|
false
|
|
61315
61334
|
) || constructs.length > 0 && isRelatedTo(
|
|
61316
61335
|
getReturnTypeOfSignature(constructs[0]),
|
|
61317
61336
|
target2,
|
|
61337
|
+
intersectionState,
|
|
61318
61338
|
1 /* Source */,
|
|
61319
61339
|
/*reportErrors*/
|
|
61320
61340
|
false
|
|
@@ -61427,7 +61447,7 @@ function createTypeChecker(host) {
|
|
|
61427
61447
|
void 0
|
|
61428
61448
|
) || emptyArray);
|
|
61429
61449
|
}
|
|
61430
|
-
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
61450
|
+
function hasExcessProperties(source2, target2, reportErrors2, intersectionState) {
|
|
61431
61451
|
var _a2;
|
|
61432
61452
|
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 4096 /* JSLiteral */) {
|
|
61433
61453
|
return false;
|
|
@@ -61439,7 +61459,11 @@ function createTypeChecker(host) {
|
|
|
61439
61459
|
let reducedTarget = target2;
|
|
61440
61460
|
let checkTypes;
|
|
61441
61461
|
if (target2.flags & 1048576 /* Union */) {
|
|
61442
|
-
|
|
61462
|
+
let isRelatedToWorker2 = function(source3, target3) {
|
|
61463
|
+
return isRelatedTo(source3, target3, intersectionState);
|
|
61464
|
+
};
|
|
61465
|
+
var isRelatedToWorker = isRelatedToWorker2;
|
|
61466
|
+
reducedTarget = findMatchingDiscriminantType(source2, target2, isRelatedToWorker2) || filterPrimitivesIfContainsNonPrimitive(target2);
|
|
61443
61467
|
checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget];
|
|
61444
61468
|
}
|
|
61445
61469
|
for (const prop of getPropertiesOfType(source2)) {
|
|
@@ -61482,7 +61506,7 @@ function createTypeChecker(host) {
|
|
|
61482
61506
|
}
|
|
61483
61507
|
return true;
|
|
61484
61508
|
}
|
|
61485
|
-
if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), 3 /* Both */, reportErrors2)) {
|
|
61509
|
+
if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), intersectionState, 3 /* Both */, reportErrors2)) {
|
|
61486
61510
|
if (reportErrors2) {
|
|
61487
61511
|
reportIncompatibleError(Diagnostics.Types_of_property_0_are_incompatible, symbolToString(prop));
|
|
61488
61512
|
}
|
|
@@ -61526,12 +61550,14 @@ function createTypeChecker(host) {
|
|
|
61526
61550
|
return isRelatedTo(
|
|
61527
61551
|
source2,
|
|
61528
61552
|
target2,
|
|
61553
|
+
intersectionState,
|
|
61529
61554
|
1 /* Source */,
|
|
61530
61555
|
/*reportErrors*/
|
|
61531
61556
|
false
|
|
61532
61557
|
) || isRelatedTo(
|
|
61533
61558
|
target2,
|
|
61534
61559
|
source2,
|
|
61560
|
+
intersectionState,
|
|
61535
61561
|
1 /* Source */,
|
|
61536
61562
|
/*reportErrors*/
|
|
61537
61563
|
false
|
|
@@ -61547,7 +61573,7 @@ function createTypeChecker(host) {
|
|
|
61547
61573
|
1 /* Source */
|
|
61548
61574
|
);
|
|
61549
61575
|
}
|
|
61550
|
-
function eachTypeRelatedToSomeType(source2, target2) {
|
|
61576
|
+
function eachTypeRelatedToSomeType(source2, target2, intersectionState) {
|
|
61551
61577
|
let result2 = -1 /* True */;
|
|
61552
61578
|
const sourceTypes = source2.types;
|
|
61553
61579
|
for (const sourceType of sourceTypes) {
|
|
@@ -61556,7 +61582,7 @@ function createTypeChecker(host) {
|
|
|
61556
61582
|
target2,
|
|
61557
61583
|
/*reportErrors*/
|
|
61558
61584
|
false,
|
|
61559
|
-
|
|
61585
|
+
intersectionState
|
|
61560
61586
|
);
|
|
61561
61587
|
if (!related) {
|
|
61562
61588
|
return 0 /* False */;
|
|
@@ -61581,12 +61607,12 @@ function createTypeChecker(host) {
|
|
|
61581
61607
|
const related = isRelatedTo(
|
|
61582
61608
|
source2,
|
|
61583
61609
|
match,
|
|
61610
|
+
intersectionState,
|
|
61584
61611
|
2 /* Target */,
|
|
61585
61612
|
/*reportErrors*/
|
|
61586
61613
|
false,
|
|
61587
61614
|
/*headMessage*/
|
|
61588
|
-
void 0
|
|
61589
|
-
intersectionState
|
|
61615
|
+
void 0
|
|
61590
61616
|
);
|
|
61591
61617
|
if (related) {
|
|
61592
61618
|
return related;
|
|
@@ -61597,29 +61623,31 @@ function createTypeChecker(host) {
|
|
|
61597
61623
|
const related = isRelatedTo(
|
|
61598
61624
|
source2,
|
|
61599
61625
|
type,
|
|
61626
|
+
intersectionState,
|
|
61600
61627
|
2 /* Target */,
|
|
61601
61628
|
/*reportErrors*/
|
|
61602
61629
|
false,
|
|
61603
61630
|
/*headMessage*/
|
|
61604
|
-
void 0
|
|
61605
|
-
intersectionState
|
|
61631
|
+
void 0
|
|
61606
61632
|
);
|
|
61607
61633
|
if (related) {
|
|
61608
61634
|
return related;
|
|
61609
61635
|
}
|
|
61610
61636
|
}
|
|
61611
61637
|
if (reportErrors2) {
|
|
61612
|
-
|
|
61638
|
+
let isRelatedToWorker2 = function(source3, target3) {
|
|
61639
|
+
return isRelatedTo(source3, target3, intersectionState);
|
|
61640
|
+
};
|
|
61641
|
+
var isRelatedToWorker = isRelatedToWorker2;
|
|
61642
|
+
const bestMatchingType = getBestMatchingType(source2, target2, isRelatedToWorker2);
|
|
61613
61643
|
if (bestMatchingType) {
|
|
61614
61644
|
isRelatedTo(
|
|
61615
61645
|
source2,
|
|
61616
61646
|
bestMatchingType,
|
|
61647
|
+
intersectionState,
|
|
61617
61648
|
2 /* Target */,
|
|
61618
61649
|
/*reportErrors*/
|
|
61619
|
-
true
|
|
61620
|
-
/*headMessage*/
|
|
61621
|
-
void 0,
|
|
61622
|
-
intersectionState
|
|
61650
|
+
true
|
|
61623
61651
|
);
|
|
61624
61652
|
}
|
|
61625
61653
|
}
|
|
@@ -61632,11 +61660,11 @@ function createTypeChecker(host) {
|
|
|
61632
61660
|
const related = isRelatedTo(
|
|
61633
61661
|
source2,
|
|
61634
61662
|
targetType,
|
|
61663
|
+
intersectionState,
|
|
61635
61664
|
2 /* Target */,
|
|
61636
61665
|
reportErrors2,
|
|
61637
61666
|
/*headMessage*/
|
|
61638
|
-
void 0
|
|
61639
|
-
intersectionState
|
|
61667
|
+
void 0
|
|
61640
61668
|
);
|
|
61641
61669
|
if (!related) {
|
|
61642
61670
|
return 0 /* False */;
|
|
@@ -61655,11 +61683,11 @@ function createTypeChecker(host) {
|
|
|
61655
61683
|
const related = isRelatedTo(
|
|
61656
61684
|
sourceTypes[i],
|
|
61657
61685
|
target2,
|
|
61686
|
+
intersectionState,
|
|
61658
61687
|
1 /* Source */,
|
|
61659
61688
|
reportErrors2 && i === len - 1,
|
|
61660
61689
|
/*headMessage*/
|
|
61661
|
-
void 0
|
|
61662
|
-
intersectionState
|
|
61690
|
+
void 0
|
|
61663
61691
|
);
|
|
61664
61692
|
if (related) {
|
|
61665
61693
|
return related;
|
|
@@ -61683,12 +61711,12 @@ function createTypeChecker(host) {
|
|
|
61683
61711
|
const related2 = isRelatedTo(
|
|
61684
61712
|
sourceType,
|
|
61685
61713
|
undefinedStrippedTarget.types[i % undefinedStrippedTarget.types.length],
|
|
61714
|
+
intersectionState,
|
|
61686
61715
|
3 /* Both */,
|
|
61687
61716
|
/*reportErrors*/
|
|
61688
61717
|
false,
|
|
61689
61718
|
/*headMessage*/
|
|
61690
|
-
void 0
|
|
61691
|
-
intersectionState
|
|
61719
|
+
void 0
|
|
61692
61720
|
);
|
|
61693
61721
|
if (related2) {
|
|
61694
61722
|
result2 &= related2;
|
|
@@ -61698,11 +61726,11 @@ function createTypeChecker(host) {
|
|
|
61698
61726
|
const related = isRelatedTo(
|
|
61699
61727
|
sourceType,
|
|
61700
61728
|
target2,
|
|
61729
|
+
intersectionState,
|
|
61701
61730
|
1 /* Source */,
|
|
61702
61731
|
reportErrors2,
|
|
61703
61732
|
/*headMessage*/
|
|
61704
|
-
void 0
|
|
61705
|
-
intersectionState
|
|
61733
|
+
void 0
|
|
61706
61734
|
);
|
|
61707
61735
|
if (!related) {
|
|
61708
61736
|
return 0 /* False */;
|
|
@@ -61728,6 +61756,7 @@ function createTypeChecker(host) {
|
|
|
61728
61756
|
related = relation === identityRelation ? isRelatedTo(
|
|
61729
61757
|
s,
|
|
61730
61758
|
t,
|
|
61759
|
+
intersectionState,
|
|
61731
61760
|
3 /* Both */,
|
|
61732
61761
|
/*reportErrors*/
|
|
61733
61762
|
false
|
|
@@ -61736,26 +61765,27 @@ function createTypeChecker(host) {
|
|
|
61736
61765
|
related = isRelatedTo(
|
|
61737
61766
|
s,
|
|
61738
61767
|
t,
|
|
61768
|
+
intersectionState,
|
|
61739
61769
|
3 /* Both */,
|
|
61740
61770
|
reportErrors2,
|
|
61741
61771
|
/*headMessage*/
|
|
61742
|
-
void 0
|
|
61743
|
-
intersectionState
|
|
61772
|
+
void 0
|
|
61744
61773
|
);
|
|
61745
61774
|
} else if (variance === 2 /* Contravariant */) {
|
|
61746
61775
|
related = isRelatedTo(
|
|
61747
61776
|
t,
|
|
61748
61777
|
s,
|
|
61778
|
+
intersectionState,
|
|
61749
61779
|
3 /* Both */,
|
|
61750
61780
|
reportErrors2,
|
|
61751
61781
|
/*headMessage*/
|
|
61752
|
-
void 0
|
|
61753
|
-
intersectionState
|
|
61782
|
+
void 0
|
|
61754
61783
|
);
|
|
61755
61784
|
} else if (variance === 3 /* Bivariant */) {
|
|
61756
61785
|
related = isRelatedTo(
|
|
61757
61786
|
t,
|
|
61758
61787
|
s,
|
|
61788
|
+
intersectionState,
|
|
61759
61789
|
3 /* Both */,
|
|
61760
61790
|
/*reportErrors*/
|
|
61761
61791
|
false
|
|
@@ -61764,32 +61794,32 @@ function createTypeChecker(host) {
|
|
|
61764
61794
|
related = isRelatedTo(
|
|
61765
61795
|
s,
|
|
61766
61796
|
t,
|
|
61797
|
+
intersectionState,
|
|
61767
61798
|
3 /* Both */,
|
|
61768
61799
|
reportErrors2,
|
|
61769
61800
|
/*headMessage*/
|
|
61770
|
-
void 0
|
|
61771
|
-
intersectionState
|
|
61801
|
+
void 0
|
|
61772
61802
|
);
|
|
61773
61803
|
}
|
|
61774
61804
|
} else {
|
|
61775
61805
|
related = isRelatedTo(
|
|
61776
61806
|
s,
|
|
61777
61807
|
t,
|
|
61808
|
+
intersectionState,
|
|
61778
61809
|
3 /* Both */,
|
|
61779
61810
|
reportErrors2,
|
|
61780
61811
|
/*headMessage*/
|
|
61781
|
-
void 0
|
|
61782
|
-
intersectionState
|
|
61812
|
+
void 0
|
|
61783
61813
|
);
|
|
61784
61814
|
if (related) {
|
|
61785
61815
|
related &= isRelatedTo(
|
|
61786
61816
|
t,
|
|
61787
61817
|
s,
|
|
61818
|
+
intersectionState,
|
|
61788
61819
|
3 /* Both */,
|
|
61789
61820
|
reportErrors2,
|
|
61790
61821
|
/*headMessage*/
|
|
61791
|
-
void 0
|
|
61792
|
-
intersectionState
|
|
61822
|
+
void 0
|
|
61793
61823
|
);
|
|
61794
61824
|
}
|
|
61795
61825
|
}
|
|
@@ -61955,12 +61985,12 @@ function createTypeChecker(host) {
|
|
|
61955
61985
|
result2 = isRelatedTo(
|
|
61956
61986
|
constraint,
|
|
61957
61987
|
target2,
|
|
61988
|
+
intersectionState,
|
|
61958
61989
|
1 /* Source */,
|
|
61959
61990
|
/*reportErrors*/
|
|
61960
61991
|
false,
|
|
61961
61992
|
/*headMessage*/
|
|
61962
|
-
void 0
|
|
61963
|
-
intersectionState
|
|
61993
|
+
void 0
|
|
61964
61994
|
);
|
|
61965
61995
|
}
|
|
61966
61996
|
}
|
|
@@ -62023,9 +62053,9 @@ function createTypeChecker(host) {
|
|
|
62023
62053
|
const targetFlags = target2.flags;
|
|
62024
62054
|
if (relation === identityRelation) {
|
|
62025
62055
|
if (sourceFlags & 3145728 /* UnionOrIntersection */) {
|
|
62026
|
-
let result3 = eachTypeRelatedToSomeType(source2, target2);
|
|
62056
|
+
let result3 = eachTypeRelatedToSomeType(source2, target2, intersectionState);
|
|
62027
62057
|
if (result3) {
|
|
62028
|
-
result3 &= eachTypeRelatedToSomeType(target2, source2);
|
|
62058
|
+
result3 &= eachTypeRelatedToSomeType(target2, source2, intersectionState);
|
|
62029
62059
|
}
|
|
62030
62060
|
return result3;
|
|
62031
62061
|
}
|
|
@@ -62033,6 +62063,7 @@ function createTypeChecker(host) {
|
|
|
62033
62063
|
return isRelatedTo(
|
|
62034
62064
|
source2.type,
|
|
62035
62065
|
target2.type,
|
|
62066
|
+
intersectionState,
|
|
62036
62067
|
3 /* Both */,
|
|
62037
62068
|
/*reportErrors*/
|
|
62038
62069
|
false
|
|
@@ -62042,6 +62073,7 @@ function createTypeChecker(host) {
|
|
|
62042
62073
|
if (result2 = isRelatedTo(
|
|
62043
62074
|
source2.objectType,
|
|
62044
62075
|
target2.objectType,
|
|
62076
|
+
intersectionState,
|
|
62045
62077
|
3 /* Both */,
|
|
62046
62078
|
/*reportErrors*/
|
|
62047
62079
|
false
|
|
@@ -62049,6 +62081,7 @@ function createTypeChecker(host) {
|
|
|
62049
62081
|
if (result2 &= isRelatedTo(
|
|
62050
62082
|
source2.indexType,
|
|
62051
62083
|
target2.indexType,
|
|
62084
|
+
intersectionState,
|
|
62052
62085
|
3 /* Both */,
|
|
62053
62086
|
/*reportErrors*/
|
|
62054
62087
|
false
|
|
@@ -62062,6 +62095,7 @@ function createTypeChecker(host) {
|
|
|
62062
62095
|
if (result2 = isRelatedTo(
|
|
62063
62096
|
source2.checkType,
|
|
62064
62097
|
target2.checkType,
|
|
62098
|
+
intersectionState,
|
|
62065
62099
|
3 /* Both */,
|
|
62066
62100
|
/*reportErrors*/
|
|
62067
62101
|
false
|
|
@@ -62069,6 +62103,7 @@ function createTypeChecker(host) {
|
|
|
62069
62103
|
if (result2 &= isRelatedTo(
|
|
62070
62104
|
source2.extendsType,
|
|
62071
62105
|
target2.extendsType,
|
|
62106
|
+
intersectionState,
|
|
62072
62107
|
3 /* Both */,
|
|
62073
62108
|
/*reportErrors*/
|
|
62074
62109
|
false
|
|
@@ -62076,6 +62111,7 @@ function createTypeChecker(host) {
|
|
|
62076
62111
|
if (result2 &= isRelatedTo(
|
|
62077
62112
|
getTrueTypeFromConditionalType(source2),
|
|
62078
62113
|
getTrueTypeFromConditionalType(target2),
|
|
62114
|
+
intersectionState,
|
|
62079
62115
|
3 /* Both */,
|
|
62080
62116
|
/*reportErrors*/
|
|
62081
62117
|
false
|
|
@@ -62083,6 +62119,7 @@ function createTypeChecker(host) {
|
|
|
62083
62119
|
if (result2 &= isRelatedTo(
|
|
62084
62120
|
getFalseTypeFromConditionalType(source2),
|
|
62085
62121
|
getFalseTypeFromConditionalType(target2),
|
|
62122
|
+
intersectionState,
|
|
62086
62123
|
3 /* Both */,
|
|
62087
62124
|
/*reportErrors*/
|
|
62088
62125
|
false
|
|
@@ -62098,6 +62135,7 @@ function createTypeChecker(host) {
|
|
|
62098
62135
|
if (result2 = isRelatedTo(
|
|
62099
62136
|
source2.baseType,
|
|
62100
62137
|
target2.baseType,
|
|
62138
|
+
intersectionState,
|
|
62101
62139
|
3 /* Both */,
|
|
62102
62140
|
/*reportErrors*/
|
|
62103
62141
|
false
|
|
@@ -62105,6 +62143,7 @@ function createTypeChecker(host) {
|
|
|
62105
62143
|
if (result2 &= isRelatedTo(
|
|
62106
62144
|
source2.constraint,
|
|
62107
62145
|
target2.constraint,
|
|
62146
|
+
intersectionState,
|
|
62108
62147
|
3 /* Both */,
|
|
62109
62148
|
/*reportErrors*/
|
|
62110
62149
|
false
|
|
@@ -62138,15 +62177,15 @@ function createTypeChecker(host) {
|
|
|
62138
62177
|
return varianceResult;
|
|
62139
62178
|
}
|
|
62140
62179
|
}
|
|
62141
|
-
if (isSingleElementGenericTupleType(source2) && !source2.target.readonly && (result2 = isRelatedTo(getTypeArguments(source2)[0], target2, 1 /* Source */)) || isSingleElementGenericTupleType(target2) && (target2.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source2) || source2)) && (result2 = isRelatedTo(source2, getTypeArguments(target2)[0], 2 /* Target */))) {
|
|
62180
|
+
if (isSingleElementGenericTupleType(source2) && !source2.target.readonly && (result2 = isRelatedTo(getTypeArguments(source2)[0], target2, intersectionState, 1 /* Source */)) || isSingleElementGenericTupleType(target2) && (target2.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source2) || source2)) && (result2 = isRelatedTo(source2, getTypeArguments(target2)[0], intersectionState, 2 /* Target */))) {
|
|
62142
62181
|
return result2;
|
|
62143
62182
|
}
|
|
62144
62183
|
if (targetFlags & 262144 /* TypeParameter */) {
|
|
62145
|
-
if (getObjectFlags(source2) & 32 /* Mapped */ && !source2.declaration.nameType && isRelatedTo(getIndexType(target2), getConstraintTypeFromMappedType(source2), 3 /* Both */)) {
|
|
62184
|
+
if (getObjectFlags(source2) & 32 /* Mapped */ && !source2.declaration.nameType && isRelatedTo(getIndexType(target2), getConstraintTypeFromMappedType(source2), intersectionState, 3 /* Both */)) {
|
|
62146
62185
|
if (!(getMappedTypeModifiers(source2) & 4 /* IncludeOptional */)) {
|
|
62147
62186
|
const templateType = getTemplateTypeFromMappedType(source2);
|
|
62148
62187
|
const indexedAccessType = getIndexedAccessType(target2, getTypeParameterFromMappedType(source2));
|
|
62149
|
-
if (result2 = isRelatedTo(templateType, indexedAccessType, 3 /* Both */, reportErrors2)) {
|
|
62188
|
+
if (result2 = isRelatedTo(templateType, indexedAccessType, intersectionState, 3 /* Both */, reportErrors2)) {
|
|
62150
62189
|
return result2;
|
|
62151
62190
|
}
|
|
62152
62191
|
}
|
|
@@ -62158,6 +62197,7 @@ function createTypeChecker(host) {
|
|
|
62158
62197
|
if (result2 = isRelatedTo(
|
|
62159
62198
|
constraint,
|
|
62160
62199
|
target2,
|
|
62200
|
+
intersectionState,
|
|
62161
62201
|
1 /* Source */,
|
|
62162
62202
|
/*reportErrors*/
|
|
62163
62203
|
false
|
|
@@ -62175,6 +62215,7 @@ function createTypeChecker(host) {
|
|
|
62175
62215
|
if (result2 = isRelatedTo(
|
|
62176
62216
|
targetType,
|
|
62177
62217
|
source2.type,
|
|
62218
|
+
intersectionState,
|
|
62178
62219
|
3 /* Both */,
|
|
62179
62220
|
/*reportErrors*/
|
|
62180
62221
|
false
|
|
@@ -62183,13 +62224,13 @@ function createTypeChecker(host) {
|
|
|
62183
62224
|
}
|
|
62184
62225
|
}
|
|
62185
62226
|
if (isTupleType(targetType)) {
|
|
62186
|
-
if (result2 = isRelatedTo(source2, getKnownKeysOfTupleType(targetType), 2 /* Target */, reportErrors2)) {
|
|
62227
|
+
if (result2 = isRelatedTo(source2, getKnownKeysOfTupleType(targetType), intersectionState, 2 /* Target */, reportErrors2)) {
|
|
62187
62228
|
return result2;
|
|
62188
62229
|
}
|
|
62189
62230
|
} else {
|
|
62190
62231
|
const constraint = getSimplifiedTypeOrConstraint(targetType);
|
|
62191
62232
|
if (constraint) {
|
|
62192
|
-
if (isRelatedTo(source2, getIndexType(constraint, target2.indexFlags | 4 /* NoReducibleCheck */), 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
62233
|
+
if (isRelatedTo(source2, getIndexType(constraint, target2.indexFlags | 4 /* NoReducibleCheck */), intersectionState, 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
62193
62234
|
return -1 /* True */;
|
|
62194
62235
|
}
|
|
62195
62236
|
} else if (isGenericMappedType(targetType)) {
|
|
@@ -62202,15 +62243,15 @@ function createTypeChecker(host) {
|
|
|
62202
62243
|
} else {
|
|
62203
62244
|
targetKeys = nameType || constraintType;
|
|
62204
62245
|
}
|
|
62205
|
-
if (isRelatedTo(source2, targetKeys, 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
62246
|
+
if (isRelatedTo(source2, targetKeys, intersectionState, 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
62206
62247
|
return -1 /* True */;
|
|
62207
62248
|
}
|
|
62208
62249
|
}
|
|
62209
62250
|
}
|
|
62210
62251
|
} else if (targetFlags & 8388608 /* IndexedAccess */) {
|
|
62211
62252
|
if (sourceFlags & 8388608 /* IndexedAccess */) {
|
|
62212
|
-
if (result2 = isRelatedTo(source2.objectType, target2.objectType, 3 /* Both */, reportErrors2)) {
|
|
62213
|
-
result2 &= isRelatedTo(source2.indexType, target2.indexType, 3 /* Both */, reportErrors2);
|
|
62253
|
+
if (result2 = isRelatedTo(source2.objectType, target2.objectType, intersectionState, 3 /* Both */, reportErrors2)) {
|
|
62254
|
+
result2 &= isRelatedTo(source2.indexType, target2.indexType, intersectionState, 3 /* Both */, reportErrors2);
|
|
62214
62255
|
}
|
|
62215
62256
|
if (result2) {
|
|
62216
62257
|
return result2;
|
|
@@ -62234,11 +62275,11 @@ function createTypeChecker(host) {
|
|
|
62234
62275
|
if (result2 = isRelatedTo(
|
|
62235
62276
|
source2,
|
|
62236
62277
|
constraint,
|
|
62278
|
+
intersectionState,
|
|
62237
62279
|
2 /* Target */,
|
|
62238
62280
|
reportErrors2,
|
|
62239
62281
|
/*headMessage*/
|
|
62240
|
-
void 0
|
|
62241
|
-
intersectionState
|
|
62282
|
+
void 0
|
|
62242
62283
|
)) {
|
|
62243
62284
|
return result2;
|
|
62244
62285
|
}
|
|
@@ -62264,18 +62305,18 @@ function createTypeChecker(host) {
|
|
|
62264
62305
|
const sourceKeys = getIndexType(source2, 2 /* NoIndexSignatures */);
|
|
62265
62306
|
const includeOptional = modifiers & 4 /* IncludeOptional */;
|
|
62266
62307
|
const filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : void 0;
|
|
62267
|
-
if (includeOptional ? !(filteredByApplicability.flags & 131072 /* Never */) : isRelatedTo(targetKeys, sourceKeys, 3 /* Both */)) {
|
|
62308
|
+
if (includeOptional ? !(filteredByApplicability.flags & 131072 /* Never */) : isRelatedTo(targetKeys, sourceKeys, intersectionState, 3 /* Both */)) {
|
|
62268
62309
|
const templateType2 = getTemplateTypeFromMappedType(target2);
|
|
62269
62310
|
const typeParameter = getTypeParameterFromMappedType(target2);
|
|
62270
62311
|
const nonNullComponent = extractTypesOfKind(templateType2, ~98304 /* Nullable */);
|
|
62271
62312
|
if (!keysRemapped && nonNullComponent.flags & 8388608 /* IndexedAccess */ && nonNullComponent.indexType === typeParameter) {
|
|
62272
|
-
if (result2 = isRelatedTo(source2, nonNullComponent.objectType, 2 /* Target */, reportErrors2)) {
|
|
62313
|
+
if (result2 = isRelatedTo(source2, nonNullComponent.objectType, intersectionState, 2 /* Target */, reportErrors2)) {
|
|
62273
62314
|
return result2;
|
|
62274
62315
|
}
|
|
62275
62316
|
} else {
|
|
62276
62317
|
const indexingType = keysRemapped ? filteredByApplicability || targetKeys : filteredByApplicability ? getIntersectionType([filteredByApplicability, typeParameter]) : typeParameter;
|
|
62277
62318
|
const indexedAccessType = getIndexedAccessType(source2, indexingType);
|
|
62278
|
-
if (result2 = isRelatedTo(indexedAccessType, templateType2, 3 /* Both */, reportErrors2)) {
|
|
62319
|
+
if (result2 = isRelatedTo(indexedAccessType, templateType2, intersectionState, 3 /* Both */, reportErrors2)) {
|
|
62279
62320
|
return result2;
|
|
62280
62321
|
}
|
|
62281
62322
|
}
|
|
@@ -62295,22 +62336,22 @@ function createTypeChecker(host) {
|
|
|
62295
62336
|
if (result2 = skipTrue ? -1 /* True */ : isRelatedTo(
|
|
62296
62337
|
source2,
|
|
62297
62338
|
getTrueTypeFromConditionalType(c),
|
|
62339
|
+
intersectionState,
|
|
62298
62340
|
2 /* Target */,
|
|
62299
62341
|
/*reportErrors*/
|
|
62300
62342
|
false,
|
|
62301
62343
|
/*headMessage*/
|
|
62302
|
-
void 0
|
|
62303
|
-
intersectionState
|
|
62344
|
+
void 0
|
|
62304
62345
|
)) {
|
|
62305
62346
|
result2 &= skipFalse ? -1 /* True */ : isRelatedTo(
|
|
62306
62347
|
source2,
|
|
62307
62348
|
getFalseTypeFromConditionalType(c),
|
|
62349
|
+
intersectionState,
|
|
62308
62350
|
2 /* Target */,
|
|
62309
62351
|
/*reportErrors*/
|
|
62310
62352
|
false,
|
|
62311
62353
|
/*headMessage*/
|
|
62312
|
-
void 0
|
|
62313
|
-
intersectionState
|
|
62354
|
+
void 0
|
|
62314
62355
|
);
|
|
62315
62356
|
if (result2) {
|
|
62316
62357
|
return result2;
|
|
@@ -62340,29 +62381,29 @@ function createTypeChecker(host) {
|
|
|
62340
62381
|
if (result2 = isRelatedTo(
|
|
62341
62382
|
constraint,
|
|
62342
62383
|
target2,
|
|
62384
|
+
intersectionState,
|
|
62343
62385
|
1 /* Source */,
|
|
62344
62386
|
/*reportErrors*/
|
|
62345
62387
|
false,
|
|
62346
62388
|
/*headMessage*/
|
|
62347
|
-
void 0
|
|
62348
|
-
intersectionState
|
|
62389
|
+
void 0
|
|
62349
62390
|
)) {
|
|
62350
62391
|
return result2;
|
|
62351
62392
|
} else if (result2 = isRelatedTo(
|
|
62352
62393
|
getTypeWithThisArgument(constraint, source2),
|
|
62353
62394
|
target2,
|
|
62395
|
+
intersectionState,
|
|
62354
62396
|
1 /* Source */,
|
|
62355
62397
|
reportErrors2 && constraint !== unknownType && !(targetFlags & sourceFlags & 262144 /* TypeParameter */),
|
|
62356
62398
|
/*headMessage*/
|
|
62357
|
-
void 0
|
|
62358
|
-
intersectionState
|
|
62399
|
+
void 0
|
|
62359
62400
|
)) {
|
|
62360
62401
|
return result2;
|
|
62361
62402
|
}
|
|
62362
62403
|
if (isMappedTypeGenericIndexedAccess(source2)) {
|
|
62363
62404
|
const indexConstraint = getConstraintOfType(source2.indexType);
|
|
62364
62405
|
if (indexConstraint) {
|
|
62365
|
-
if (result2 = isRelatedTo(getIndexedAccessType(source2.objectType, indexConstraint), target2, 1 /* Source */, reportErrors2)) {
|
|
62406
|
+
if (result2 = isRelatedTo(getIndexedAccessType(source2.objectType, indexConstraint), target2, intersectionState, 1 /* Source */, reportErrors2)) {
|
|
62366
62407
|
return result2;
|
|
62367
62408
|
}
|
|
62368
62409
|
}
|
|
@@ -62370,21 +62411,21 @@ function createTypeChecker(host) {
|
|
|
62370
62411
|
}
|
|
62371
62412
|
} else if (sourceFlags & 4194304 /* Index */) {
|
|
62372
62413
|
const isDeferredMappedIndex = shouldDeferIndexType(source2.type, source2.indexFlags) && getObjectFlags(source2.type) & 32 /* Mapped */;
|
|
62373
|
-
if (result2 = isRelatedTo(stringNumberSymbolType, target2, 1 /* Source */, reportErrors2 && !isDeferredMappedIndex)) {
|
|
62414
|
+
if (result2 = isRelatedTo(stringNumberSymbolType, target2, intersectionState, 1 /* Source */, reportErrors2 && !isDeferredMappedIndex)) {
|
|
62374
62415
|
return result2;
|
|
62375
62416
|
}
|
|
62376
62417
|
if (isDeferredMappedIndex) {
|
|
62377
62418
|
const mappedType = source2.type;
|
|
62378
62419
|
const nameType = getNameTypeFromMappedType(mappedType);
|
|
62379
62420
|
const sourceMappedKeys = nameType && isMappedTypeWithKeyofConstraintDeclaration(mappedType) ? getApparentMappedTypeKeys(nameType, mappedType) : nameType || getConstraintTypeFromMappedType(mappedType);
|
|
62380
|
-
if (result2 = isRelatedTo(sourceMappedKeys, target2, 1 /* Source */, reportErrors2)) {
|
|
62421
|
+
if (result2 = isRelatedTo(sourceMappedKeys, target2, intersectionState, 1 /* Source */, reportErrors2)) {
|
|
62381
62422
|
return result2;
|
|
62382
62423
|
}
|
|
62383
62424
|
}
|
|
62384
62425
|
} else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
|
|
62385
62426
|
if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
|
|
62386
62427
|
const constraint = getBaseConstraintOfType(source2);
|
|
62387
|
-
if (constraint && constraint !== source2 && (result2 = isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2))) {
|
|
62428
|
+
if (constraint && constraint !== source2 && (result2 = isRelatedTo(constraint, target2, intersectionState, 1 /* Source */, reportErrors2))) {
|
|
62388
62429
|
return result2;
|
|
62389
62430
|
}
|
|
62390
62431
|
}
|
|
@@ -62393,12 +62434,12 @@ function createTypeChecker(host) {
|
|
|
62393
62434
|
if (source2.symbol !== target2.symbol) {
|
|
62394
62435
|
return 0 /* False */;
|
|
62395
62436
|
}
|
|
62396
|
-
if (result2 = isRelatedTo(source2.type, target2.type, 3 /* Both */, reportErrors2)) {
|
|
62437
|
+
if (result2 = isRelatedTo(source2.type, target2.type, intersectionState, 3 /* Both */, reportErrors2)) {
|
|
62397
62438
|
return result2;
|
|
62398
62439
|
}
|
|
62399
62440
|
} else {
|
|
62400
62441
|
const constraint = getBaseConstraintOfType(source2);
|
|
62401
|
-
if (constraint && (result2 = isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2))) {
|
|
62442
|
+
if (constraint && (result2 = isRelatedTo(constraint, target2, intersectionState, 1 /* Source */, reportErrors2))) {
|
|
62402
62443
|
return result2;
|
|
62403
62444
|
}
|
|
62404
62445
|
}
|
|
@@ -62411,20 +62452,24 @@ function createTypeChecker(host) {
|
|
|
62411
62452
|
let sourceExtends = source2.extendsType;
|
|
62412
62453
|
let mapper;
|
|
62413
62454
|
if (sourceParams) {
|
|
62455
|
+
let isRelatedToWorker2 = function(source3, target3, reportErrors3) {
|
|
62456
|
+
return isRelatedTo(source3, target3, 0 /* None */, 3 /* Both */, reportErrors3);
|
|
62457
|
+
};
|
|
62458
|
+
var isRelatedToWorker = isRelatedToWorker2;
|
|
62414
62459
|
const ctx = createInferenceContext(
|
|
62415
62460
|
sourceParams,
|
|
62416
62461
|
/*signature*/
|
|
62417
62462
|
void 0,
|
|
62418
62463
|
0 /* None */,
|
|
62419
|
-
|
|
62464
|
+
isRelatedToWorker2
|
|
62420
62465
|
);
|
|
62421
62466
|
inferTypes(ctx.inferences, target2.extendsType, sourceExtends, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
|
|
62422
62467
|
sourceExtends = instantiateType(sourceExtends, ctx.mapper);
|
|
62423
62468
|
mapper = ctx.mapper;
|
|
62424
62469
|
}
|
|
62425
|
-
if (isTypeIdenticalTo(sourceExtends, target2.extendsType) && (isRelatedTo(source2.checkType, target2.checkType, 3 /* Both */) || isRelatedTo(target2.checkType, source2.checkType, 3 /* Both */))) {
|
|
62426
|
-
if (result2 = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source2), mapper), getTrueTypeFromConditionalType(target2), 3 /* Both */, reportErrors2)) {
|
|
62427
|
-
result2 &= isRelatedTo(getFalseTypeFromConditionalType(source2), getFalseTypeFromConditionalType(target2), 3 /* Both */, reportErrors2);
|
|
62470
|
+
if (isTypeIdenticalTo(sourceExtends, target2.extendsType) && (isRelatedTo(source2.checkType, target2.checkType, intersectionState, 3 /* Both */) || isRelatedTo(target2.checkType, source2.checkType, intersectionState, 3 /* Both */))) {
|
|
62471
|
+
if (result2 = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source2), mapper), getTrueTypeFromConditionalType(target2), intersectionState, 3 /* Both */, reportErrors2)) {
|
|
62472
|
+
result2 &= isRelatedTo(getFalseTypeFromConditionalType(source2), getFalseTypeFromConditionalType(target2), intersectionState, 3 /* Both */, reportErrors2);
|
|
62428
62473
|
}
|
|
62429
62474
|
if (result2) {
|
|
62430
62475
|
return result2;
|
|
@@ -62433,14 +62478,14 @@ function createTypeChecker(host) {
|
|
|
62433
62478
|
}
|
|
62434
62479
|
const defaultConstraint = getDefaultConstraintOfConditionalType(source2);
|
|
62435
62480
|
if (defaultConstraint) {
|
|
62436
|
-
if (result2 = isRelatedTo(defaultConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
62481
|
+
if (result2 = isRelatedTo(defaultConstraint, target2, intersectionState, 1 /* Source */, reportErrors2)) {
|
|
62437
62482
|
return result2;
|
|
62438
62483
|
}
|
|
62439
62484
|
}
|
|
62440
62485
|
const distributiveConstraint = !(targetFlags & 16777216 /* Conditional */) && hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
|
|
62441
62486
|
if (distributiveConstraint) {
|
|
62442
62487
|
resetErrorInfo(saveErrorInfo);
|
|
62443
|
-
if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
62488
|
+
if (result2 = isRelatedTo(distributiveConstraint, target2, intersectionState, 1 /* Source */, reportErrors2)) {
|
|
62444
62489
|
return result2;
|
|
62445
62490
|
}
|
|
62446
62491
|
}
|
|
@@ -62450,7 +62495,7 @@ function createTypeChecker(host) {
|
|
|
62450
62495
|
}
|
|
62451
62496
|
if (isGenericMappedType(target2)) {
|
|
62452
62497
|
if (isGenericMappedType(source2)) {
|
|
62453
|
-
if (result2 = mappedTypeRelatedTo(source2, target2, reportErrors2)) {
|
|
62498
|
+
if (result2 = mappedTypeRelatedTo(source2, target2, reportErrors2, intersectionState)) {
|
|
62454
62499
|
return result2;
|
|
62455
62500
|
}
|
|
62456
62501
|
}
|
|
@@ -62477,14 +62522,14 @@ function createTypeChecker(host) {
|
|
|
62477
62522
|
}
|
|
62478
62523
|
} else if (isReadonlyArrayType(target2) ? everyType(source2, isArrayOrTupleType) : isArrayType(target2) && everyType(source2, (t) => isTupleType(t) && !t.target.readonly)) {
|
|
62479
62524
|
if (relation !== identityRelation) {
|
|
62480
|
-
return isRelatedTo(getIndexTypeOfType(source2, numberType) || anyType, getIndexTypeOfType(target2, numberType) || anyType, 3 /* Both */, reportErrors2);
|
|
62525
|
+
return isRelatedTo(getIndexTypeOfType(source2, numberType) || anyType, getIndexTypeOfType(target2, numberType) || anyType, intersectionState, 3 /* Both */, reportErrors2);
|
|
62481
62526
|
} else {
|
|
62482
62527
|
return 0 /* False */;
|
|
62483
62528
|
}
|
|
62484
62529
|
} else if (isGenericTupleType(source2) && isTupleType(target2) && !isGenericTupleType(target2)) {
|
|
62485
62530
|
const constraint = getBaseConstraintOrType(source2);
|
|
62486
62531
|
if (constraint !== source2) {
|
|
62487
|
-
return isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2);
|
|
62532
|
+
return isRelatedTo(constraint, target2, intersectionState, 1 /* Source */, reportErrors2);
|
|
62488
62533
|
}
|
|
62489
62534
|
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) & 8192 /* FreshLiteral */ && !isEmptyObjectType(source2)) {
|
|
62490
62535
|
return 0 /* False */;
|
|
@@ -62552,16 +62597,16 @@ function createTypeChecker(host) {
|
|
|
62552
62597
|
}
|
|
62553
62598
|
}
|
|
62554
62599
|
}
|
|
62555
|
-
function mappedTypeRelatedTo(source2, target2, reportErrors2) {
|
|
62600
|
+
function mappedTypeRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
62556
62601
|
const modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source2) === getMappedTypeModifiers(target2) : getCombinedMappedTypeOptionality(source2) <= getCombinedMappedTypeOptionality(target2));
|
|
62557
62602
|
if (modifiersRelated) {
|
|
62558
62603
|
let result2;
|
|
62559
62604
|
const targetConstraint = getConstraintTypeFromMappedType(target2);
|
|
62560
62605
|
const sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source2), getCombinedMappedTypeOptionality(source2) < 0 ? reportUnmeasurableMapper : reportUnreliableMapper);
|
|
62561
|
-
if (result2 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors2)) {
|
|
62606
|
+
if (result2 = isRelatedTo(targetConstraint, sourceConstraint, intersectionState, 3 /* Both */, reportErrors2)) {
|
|
62562
62607
|
const mapper = createTypeMapper([getTypeParameterFromMappedType(source2)], [getTypeParameterFromMappedType(target2)]);
|
|
62563
62608
|
if (instantiateType(getNameTypeFromMappedType(source2), mapper) === instantiateType(getNameTypeFromMappedType(target2), mapper)) {
|
|
62564
|
-
return result2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source2), mapper), getTemplateTypeFromMappedType(target2), 3 /* Both */, reportErrors2);
|
|
62609
|
+
return result2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source2), mapper), getTemplateTypeFromMappedType(target2), intersectionState, 3 /* Both */, reportErrors2);
|
|
62565
62610
|
}
|
|
62566
62611
|
}
|
|
62567
62612
|
}
|
|
@@ -62701,11 +62746,11 @@ function createTypeChecker(host) {
|
|
|
62701
62746
|
return isRelatedTo(
|
|
62702
62747
|
effectiveSource,
|
|
62703
62748
|
effectiveTarget,
|
|
62749
|
+
intersectionState,
|
|
62704
62750
|
3 /* Both */,
|
|
62705
62751
|
reportErrors2,
|
|
62706
62752
|
/*headMessage*/
|
|
62707
|
-
void 0
|
|
62708
|
-
intersectionState
|
|
62753
|
+
void 0
|
|
62709
62754
|
);
|
|
62710
62755
|
}
|
|
62711
62756
|
function propertyRelatedTo(source2, target2, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState, skipOptional) {
|
|
@@ -62813,7 +62858,7 @@ function createTypeChecker(host) {
|
|
|
62813
62858
|
}
|
|
62814
62859
|
function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, optionalsOnly, intersectionState) {
|
|
62815
62860
|
if (relation === identityRelation) {
|
|
62816
|
-
return propertiesIdenticalTo(source2, target2, excludedProperties);
|
|
62861
|
+
return propertiesIdenticalTo(source2, target2, excludedProperties, intersectionState);
|
|
62817
62862
|
}
|
|
62818
62863
|
let result2 = -1 /* True */;
|
|
62819
62864
|
if (isTupleType(target2)) {
|
|
@@ -62892,11 +62937,11 @@ function createTypeChecker(host) {
|
|
|
62892
62937
|
const related = isRelatedTo(
|
|
62893
62938
|
sourceType,
|
|
62894
62939
|
targetCheckType,
|
|
62940
|
+
intersectionState,
|
|
62895
62941
|
3 /* Both */,
|
|
62896
62942
|
reportErrors2,
|
|
62897
62943
|
/*headMessage*/
|
|
62898
|
-
void 0
|
|
62899
|
-
intersectionState
|
|
62944
|
+
void 0
|
|
62900
62945
|
);
|
|
62901
62946
|
if (!related) {
|
|
62902
62947
|
if (reportErrors2 && (targetArity > 1 || sourceArity > 1)) {
|
|
@@ -62960,7 +63005,7 @@ function createTypeChecker(host) {
|
|
|
62960
63005
|
}
|
|
62961
63006
|
return result2;
|
|
62962
63007
|
}
|
|
62963
|
-
function propertiesIdenticalTo(source2, target2, excludedProperties) {
|
|
63008
|
+
function propertiesIdenticalTo(source2, target2, excludedProperties, intersectionState) {
|
|
62964
63009
|
if (!(source2.flags & 524288 /* Object */ && target2.flags & 524288 /* Object */)) {
|
|
62965
63010
|
return 0 /* False */;
|
|
62966
63011
|
}
|
|
@@ -62975,18 +63020,21 @@ function createTypeChecker(host) {
|
|
|
62975
63020
|
if (!targetProp) {
|
|
62976
63021
|
return 0 /* False */;
|
|
62977
63022
|
}
|
|
62978
|
-
const related = compareProperties(sourceProp, targetProp,
|
|
63023
|
+
const related = compareProperties(sourceProp, targetProp, isRelatedToWorker);
|
|
62979
63024
|
if (!related) {
|
|
62980
63025
|
return 0 /* False */;
|
|
62981
63026
|
}
|
|
62982
63027
|
result2 &= related;
|
|
62983
63028
|
}
|
|
62984
63029
|
return result2;
|
|
63030
|
+
function isRelatedToWorker(source3, target3) {
|
|
63031
|
+
return isRelatedTo(source3, target3, intersectionState);
|
|
63032
|
+
}
|
|
62985
63033
|
}
|
|
62986
63034
|
function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) {
|
|
62987
63035
|
var _a2, _b;
|
|
62988
63036
|
if (relation === identityRelation) {
|
|
62989
|
-
return signaturesIdenticalTo(source2, target2, kind);
|
|
63037
|
+
return signaturesIdenticalTo(source2, target2, kind, intersectionState);
|
|
62990
63038
|
}
|
|
62991
63039
|
if (target2 === anyFunctionType || source2 === anyFunctionType) {
|
|
62992
63040
|
return -1 /* True */;
|
|
@@ -63115,20 +63163,20 @@ function createTypeChecker(host) {
|
|
|
63115
63163
|
}
|
|
63116
63164
|
function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) {
|
|
63117
63165
|
const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */;
|
|
63118
|
-
return compareSignaturesRelated(erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, checkMode, reportErrors2, reportError, incompatibleReporter,
|
|
63119
|
-
function
|
|
63166
|
+
return compareSignaturesRelated(erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, checkMode, reportErrors2, reportError, incompatibleReporter, isRelatedToWorker, reportUnreliableMapper);
|
|
63167
|
+
function isRelatedToWorker(source3, target3, reportErrors3) {
|
|
63120
63168
|
return isRelatedTo(
|
|
63121
63169
|
source3,
|
|
63122
63170
|
target3,
|
|
63171
|
+
intersectionState,
|
|
63123
63172
|
3 /* Both */,
|
|
63124
63173
|
reportErrors3,
|
|
63125
63174
|
/*headMessage*/
|
|
63126
|
-
void 0
|
|
63127
|
-
intersectionState
|
|
63175
|
+
void 0
|
|
63128
63176
|
);
|
|
63129
63177
|
}
|
|
63130
63178
|
}
|
|
63131
|
-
function signaturesIdenticalTo(source2, target2, kind) {
|
|
63179
|
+
function signaturesIdenticalTo(source2, target2, kind, intersectionState) {
|
|
63132
63180
|
const sourceSignatures = getSignaturesOfType(source2, kind);
|
|
63133
63181
|
const targetSignatures = getSignaturesOfType(target2, kind);
|
|
63134
63182
|
if (sourceSignatures.length !== targetSignatures.length) {
|
|
@@ -63145,7 +63193,7 @@ function createTypeChecker(host) {
|
|
|
63145
63193
|
false,
|
|
63146
63194
|
/*ignoreReturnTypes*/
|
|
63147
63195
|
false,
|
|
63148
|
-
|
|
63196
|
+
isRelatedToWorker
|
|
63149
63197
|
);
|
|
63150
63198
|
if (!related) {
|
|
63151
63199
|
return 0 /* False */;
|
|
@@ -63153,6 +63201,9 @@ function createTypeChecker(host) {
|
|
|
63153
63201
|
result2 &= related;
|
|
63154
63202
|
}
|
|
63155
63203
|
return result2;
|
|
63204
|
+
function isRelatedToWorker(source3, target3) {
|
|
63205
|
+
return isRelatedTo(source3, target3, intersectionState);
|
|
63206
|
+
}
|
|
63156
63207
|
}
|
|
63157
63208
|
function membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState) {
|
|
63158
63209
|
let result2 = -1 /* True */;
|
|
@@ -63168,11 +63219,11 @@ function createTypeChecker(host) {
|
|
|
63168
63219
|
const related = isRelatedTo(
|
|
63169
63220
|
type,
|
|
63170
63221
|
targetInfo.type,
|
|
63222
|
+
intersectionState,
|
|
63171
63223
|
3 /* Both */,
|
|
63172
63224
|
reportErrors2,
|
|
63173
63225
|
/*headMessage*/
|
|
63174
|
-
void 0
|
|
63175
|
-
intersectionState
|
|
63226
|
+
void 0
|
|
63176
63227
|
);
|
|
63177
63228
|
if (!related) {
|
|
63178
63229
|
if (reportErrors2) {
|
|
@@ -63198,11 +63249,11 @@ function createTypeChecker(host) {
|
|
|
63198
63249
|
const related = isRelatedTo(
|
|
63199
63250
|
sourceInfo.type,
|
|
63200
63251
|
targetInfo.type,
|
|
63252
|
+
intersectionState,
|
|
63201
63253
|
3 /* Both */,
|
|
63202
63254
|
reportErrors2,
|
|
63203
63255
|
/*headMessage*/
|
|
63204
|
-
void 0
|
|
63205
|
-
intersectionState
|
|
63256
|
+
void 0
|
|
63206
63257
|
);
|
|
63207
63258
|
if (!related && reportErrors2) {
|
|
63208
63259
|
if (sourceInfo.keyType === targetInfo.keyType) {
|
|
@@ -63215,13 +63266,13 @@ function createTypeChecker(host) {
|
|
|
63215
63266
|
}
|
|
63216
63267
|
function indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportErrors2, intersectionState) {
|
|
63217
63268
|
if (relation === identityRelation) {
|
|
63218
|
-
return indexSignaturesIdenticalTo(source2, target2);
|
|
63269
|
+
return indexSignaturesIdenticalTo(source2, target2, intersectionState);
|
|
63219
63270
|
}
|
|
63220
63271
|
const indexInfos = getIndexInfosOfType(target2);
|
|
63221
63272
|
const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType);
|
|
63222
63273
|
let result2 = -1 /* True */;
|
|
63223
63274
|
for (const targetInfo of indexInfos) {
|
|
63224
|
-
const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
63275
|
+
const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, intersectionState, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
63225
63276
|
if (!related) {
|
|
63226
63277
|
return 0 /* False */;
|
|
63227
63278
|
}
|
|
@@ -63242,7 +63293,7 @@ function createTypeChecker(host) {
|
|
|
63242
63293
|
}
|
|
63243
63294
|
return 0 /* False */;
|
|
63244
63295
|
}
|
|
63245
|
-
function indexSignaturesIdenticalTo(source2, target2) {
|
|
63296
|
+
function indexSignaturesIdenticalTo(source2, target2, intersectionState) {
|
|
63246
63297
|
const sourceInfos = getIndexInfosOfType(source2);
|
|
63247
63298
|
const targetInfos = getIndexInfosOfType(target2);
|
|
63248
63299
|
if (sourceInfos.length !== targetInfos.length) {
|
|
@@ -63250,7 +63301,7 @@ function createTypeChecker(host) {
|
|
|
63250
63301
|
}
|
|
63251
63302
|
for (const targetInfo of targetInfos) {
|
|
63252
63303
|
const sourceInfo = getIndexInfoOfType(source2, targetInfo.keyType);
|
|
63253
|
-
if (!(sourceInfo && isRelatedTo(sourceInfo.type, targetInfo.type, 3 /* Both */) && sourceInfo.isReadonly === targetInfo.isReadonly)) {
|
|
63304
|
+
if (!(sourceInfo && isRelatedTo(sourceInfo.type, targetInfo.type, intersectionState, 3 /* Both */) && sourceInfo.isReadonly === targetInfo.isReadonly)) {
|
|
63254
63305
|
return 0 /* False */;
|
|
63255
63306
|
}
|
|
63256
63307
|
}
|
|
@@ -83188,20 +83239,7 @@ function createTypeChecker(host) {
|
|
|
83188
83239
|
if (!signatureDeclaration) {
|
|
83189
83240
|
return factory.createToken(133 /* AnyKeyword */);
|
|
83190
83241
|
}
|
|
83191
|
-
|
|
83192
|
-
const typePredicate = getTypePredicateOfSignature(signature);
|
|
83193
|
-
if (typePredicate) {
|
|
83194
|
-
return nodeBuilder.typePredicateToTypePredicateNode(typePredicate, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker);
|
|
83195
|
-
}
|
|
83196
|
-
return nodeBuilder.expressionOrTypeToTypeNode(
|
|
83197
|
-
getPossibleTypeNodeReuseExpression(signatureDeclaration),
|
|
83198
|
-
getReturnTypeOfSignature(signature),
|
|
83199
|
-
/*addUndefined*/
|
|
83200
|
-
void 0,
|
|
83201
|
-
enclosingDeclaration,
|
|
83202
|
-
flags | 1024 /* MultilineObjectLiterals */,
|
|
83203
|
-
tracker
|
|
83204
|
-
);
|
|
83242
|
+
return nodeBuilder.serializeReturnTypeForSignature(getSignatureFromDeclaration(signatureDeclaration), enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker);
|
|
83205
83243
|
}
|
|
83206
83244
|
function createTypeOfExpression(exprIn, enclosingDeclaration, flags, tracker) {
|
|
83207
83245
|
const expr = getParseTreeNode(exprIn, isExpression);
|
|
@@ -121951,7 +121989,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121951
121989
|
impliedFormatPackageJsons.delete(newFile.resolvedPath);
|
|
121952
121990
|
});
|
|
121953
121991
|
impliedFormatPackageJsons.forEach((existing, path) => {
|
|
121954
|
-
|
|
121992
|
+
const newFile = newProgram == null ? void 0 : newProgram.getSourceFileByPath(path);
|
|
121993
|
+
if (!newFile || newFile.resolvedPath !== path) {
|
|
121955
121994
|
existing.forEach((location) => fileWatchesOfAffectingLocations.get(location).files--);
|
|
121956
121995
|
impliedFormatPackageJsons.delete(path);
|
|
121957
121996
|
}
|