@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/typescript.js
CHANGED
|
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2328
2328
|
|
|
2329
2329
|
// src/compiler/corePublic.ts
|
|
2330
2330
|
var versionMajorMinor = "5.5";
|
|
2331
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2331
|
+
var version = `${versionMajorMinor}.0-insiders.20240328`;
|
|
2332
2332
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2333
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2334
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -47431,17 +47431,23 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
|
|
|
47431
47431
|
if (sourceIsInternal && !targetIsInternal || !sourceIsInternal && targetIsInternal) {
|
|
47432
47432
|
return maybeNonRelative;
|
|
47433
47433
|
}
|
|
47434
|
-
|
|
47435
|
-
|
|
47436
|
-
|
|
47437
|
-
|
|
47438
|
-
if (nearestSourcePackageJson !== nearestTargetPackageJson) {
|
|
47434
|
+
const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath));
|
|
47435
|
+
const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);
|
|
47436
|
+
const ignoreCase = !hostUsesCaseSensitiveFileNames(host);
|
|
47437
|
+
if (!packageJsonPathsAreEqual(nearestTargetPackageJson, nearestSourcePackageJson, ignoreCase)) {
|
|
47439
47438
|
return maybeNonRelative;
|
|
47440
47439
|
}
|
|
47441
47440
|
return relativePath;
|
|
47442
47441
|
}
|
|
47443
47442
|
return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative;
|
|
47444
47443
|
}
|
|
47444
|
+
function packageJsonPathsAreEqual(a, b, ignoreCase) {
|
|
47445
|
+
if (a === b)
|
|
47446
|
+
return true;
|
|
47447
|
+
if (a === void 0 || b === void 0)
|
|
47448
|
+
return false;
|
|
47449
|
+
return comparePaths(a, b, ignoreCase) === 0 /* EqualTo */;
|
|
47450
|
+
}
|
|
47445
47451
|
function countPathComponents(path) {
|
|
47446
47452
|
let count = 0;
|
|
47447
47453
|
for (let i = startsWith(path, "./") ? 2 : 0; i < path.length; i++) {
|
|
@@ -52736,6 +52742,7 @@ function createTypeChecker(host) {
|
|
|
52736
52742
|
void 0,
|
|
52737
52743
|
addUndefined
|
|
52738
52744
|
)),
|
|
52745
|
+
serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => serializeReturnTypeForSignature(context, signature)),
|
|
52739
52746
|
indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => indexInfoToIndexSignatureDeclarationHelper(
|
|
52740
52747
|
indexInfo,
|
|
52741
52748
|
context,
|
|
@@ -53820,9 +53827,8 @@ function createTypeChecker(host) {
|
|
|
53820
53827
|
}
|
|
53821
53828
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
53822
53829
|
var _a;
|
|
53823
|
-
const
|
|
53824
|
-
|
|
53825
|
-
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
53830
|
+
const flags = context.flags;
|
|
53831
|
+
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
53826
53832
|
context.approximateLength += 3;
|
|
53827
53833
|
let typeParameters;
|
|
53828
53834
|
let typeArguments;
|
|
@@ -53903,22 +53909,12 @@ function createTypeChecker(host) {
|
|
|
53903
53909
|
if (thisParameter) {
|
|
53904
53910
|
parameters.unshift(thisParameter);
|
|
53905
53911
|
}
|
|
53906
|
-
|
|
53907
|
-
const
|
|
53908
|
-
if (typePredicate) {
|
|
53909
|
-
returnTypeNode = typePredicateToTypePredicateNodeHelper(typePredicate, context);
|
|
53910
|
-
} else {
|
|
53911
|
-
const returnType = getReturnTypeOfSignature(signature);
|
|
53912
|
-
if (returnType && !(suppressAny && isTypeAny(returnType))) {
|
|
53913
|
-
returnTypeNode = serializeReturnTypeForSignature(context, returnType, signature, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports);
|
|
53914
|
-
} else if (!suppressAny) {
|
|
53915
|
-
returnTypeNode = factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
53916
|
-
}
|
|
53917
|
-
}
|
|
53912
|
+
context.flags = flags;
|
|
53913
|
+
const returnTypeNode = serializeReturnTypeForSignature(context, signature, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports);
|
|
53918
53914
|
let modifiers = options == null ? void 0 : options.modifiers;
|
|
53919
53915
|
if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
|
|
53920
|
-
const
|
|
53921
|
-
modifiers = factory.createModifiersFromModifierFlags(
|
|
53916
|
+
const flags2 = modifiersToFlags(modifiers);
|
|
53917
|
+
modifiers = factory.createModifiersFromModifierFlags(flags2 | 64 /* Abstract */);
|
|
53922
53918
|
}
|
|
53923
53919
|
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(
|
|
53924
53920
|
modifiers,
|
|
@@ -54662,7 +54658,24 @@ function createTypeChecker(host) {
|
|
|
54662
54658
|
}
|
|
54663
54659
|
return false;
|
|
54664
54660
|
}
|
|
54665
|
-
function serializeReturnTypeForSignature(context,
|
|
54661
|
+
function serializeReturnTypeForSignature(context, signature, includePrivateSymbol, bundled) {
|
|
54662
|
+
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
54663
|
+
const flags = context.flags;
|
|
54664
|
+
if (suppressAny)
|
|
54665
|
+
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
54666
|
+
let returnTypeNode;
|
|
54667
|
+
const returnType = getReturnTypeOfSignature(signature);
|
|
54668
|
+
if (returnType && !(suppressAny && isTypeAny(returnType))) {
|
|
54669
|
+
returnTypeNode = serializeReturnTypeForSignatureWorker(context, signature, includePrivateSymbol, bundled);
|
|
54670
|
+
} else if (!suppressAny) {
|
|
54671
|
+
returnTypeNode = factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
54672
|
+
}
|
|
54673
|
+
context.flags = flags;
|
|
54674
|
+
return returnTypeNode;
|
|
54675
|
+
}
|
|
54676
|
+
function serializeReturnTypeForSignatureWorker(context, signature, includePrivateSymbol, bundled) {
|
|
54677
|
+
const typePredicate = getTypePredicateOfSignature(signature);
|
|
54678
|
+
const type = getReturnTypeOfSignature(signature);
|
|
54666
54679
|
if (!isErrorType(type) && context.enclosingDeclaration) {
|
|
54667
54680
|
const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
|
54668
54681
|
const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
|
|
@@ -54675,7 +54688,11 @@ function createTypeChecker(host) {
|
|
|
54675
54688
|
}
|
|
54676
54689
|
}
|
|
54677
54690
|
}
|
|
54678
|
-
|
|
54691
|
+
if (typePredicate) {
|
|
54692
|
+
return typePredicateToTypePredicateNodeHelper(typePredicate, context);
|
|
54693
|
+
}
|
|
54694
|
+
const expr = signature.declaration && getPossibleTypeNodeReuseExpression(signature.declaration);
|
|
54695
|
+
return expressionOrTypeToTypeNode(context, expr, type);
|
|
54679
54696
|
}
|
|
54680
54697
|
function trackExistingEntityName(node, context, includePrivateSymbol) {
|
|
54681
54698
|
let introducesError = false;
|
|
@@ -54840,30 +54857,24 @@ function createTypeChecker(host) {
|
|
|
54840
54857
|
node.isTypeOf
|
|
54841
54858
|
);
|
|
54842
54859
|
}
|
|
54843
|
-
if (
|
|
54844
|
-
|
|
54845
|
-
return factory.updateParameterDeclaration(
|
|
54846
|
-
node,
|
|
54847
|
-
/*modifiers*/
|
|
54848
|
-
void 0,
|
|
54849
|
-
node.dotDotDotToken,
|
|
54850
|
-
visitEachChild(
|
|
54851
|
-
node.name,
|
|
54852
|
-
visitExistingNodeTreeSymbols,
|
|
54853
|
-
/*context*/
|
|
54854
|
-
void 0
|
|
54855
|
-
),
|
|
54856
|
-
node.questionToken,
|
|
54857
|
-
factory.createKeywordTypeNode(133 /* AnyKeyword */),
|
|
54858
|
-
/*initializer*/
|
|
54859
|
-
void 0
|
|
54860
|
-
);
|
|
54861
|
-
}
|
|
54860
|
+
if (isNamedDeclaration(node) && node.name.kind === 167 /* ComputedPropertyName */ && !isLateBindableName(node.name)) {
|
|
54861
|
+
return void 0;
|
|
54862
54862
|
}
|
|
54863
|
-
if (isPropertySignature(node)) {
|
|
54864
|
-
|
|
54865
|
-
|
|
54863
|
+
if (isFunctionLike(node) && !node.type || isPropertyDeclaration(node) && !node.type && !node.initializer || isPropertySignature(node) && !node.type && !node.initializer || isParameter(node) && !node.type && !node.initializer) {
|
|
54864
|
+
let visited = visitEachChild(
|
|
54865
|
+
node,
|
|
54866
|
+
visitExistingNodeTreeSymbols,
|
|
54867
|
+
/*context*/
|
|
54868
|
+
void 0
|
|
54869
|
+
);
|
|
54870
|
+
if (visited === node) {
|
|
54871
|
+
visited = setTextRange(factory.cloneNode(node), node);
|
|
54866
54872
|
}
|
|
54873
|
+
visited.type = factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
54874
|
+
if (isParameter(node)) {
|
|
54875
|
+
visited.modifiers = void 0;
|
|
54876
|
+
}
|
|
54877
|
+
return visited;
|
|
54867
54878
|
}
|
|
54868
54879
|
if (isEntityName(node) || isEntityNameExpression(node)) {
|
|
54869
54880
|
const { introducesError, node: result } = trackExistingEntityName(node, context, includePrivateSymbol);
|
|
@@ -59562,11 +59573,15 @@ function createTypeChecker(host) {
|
|
|
59562
59573
|
const modifiers = getMappedTypeModifiers(type);
|
|
59563
59574
|
return modifiers & 8 /* ExcludeOptional */ ? -1 : modifiers & 4 /* IncludeOptional */ ? 1 : 0;
|
|
59564
59575
|
}
|
|
59565
|
-
function getModifiersTypeOptionality(type) {
|
|
59566
|
-
return type.flags & 2097152 /* Intersection */ ? Math.max(...map(type.types, getModifiersTypeOptionality)) : getObjectFlags(type) & 32 /* Mapped */ ? getCombinedMappedTypeOptionality(type) : 0;
|
|
59567
|
-
}
|
|
59568
59576
|
function getCombinedMappedTypeOptionality(type) {
|
|
59569
|
-
|
|
59577
|
+
if (getObjectFlags(type) & 32 /* Mapped */) {
|
|
59578
|
+
return getMappedTypeOptionality(type) || getCombinedMappedTypeOptionality(getModifiersTypeFromMappedType(type));
|
|
59579
|
+
}
|
|
59580
|
+
if (type.flags & 2097152 /* Intersection */) {
|
|
59581
|
+
const optionality = getCombinedMappedTypeOptionality(type.types[0]);
|
|
59582
|
+
return every(type.types, (t, i) => i === 0 || getCombinedMappedTypeOptionality(t) === optionality) ? optionality : 0;
|
|
59583
|
+
}
|
|
59584
|
+
return 0;
|
|
59570
59585
|
}
|
|
59571
59586
|
function isPartialMappedType(type) {
|
|
59572
59587
|
return !!(getObjectFlags(type) & 32 /* Mapped */ && getMappedTypeModifiers(type) & 4 /* IncludeOptional */);
|
|
@@ -63375,13 +63390,18 @@ function createTypeChecker(host) {
|
|
|
63375
63390
|
const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]);
|
|
63376
63391
|
const templateMapper = combineTypeMappers(objectType.mapper, mapper);
|
|
63377
63392
|
const instantiatedTemplateType = instantiateType(getTemplateTypeFromMappedType(objectType.target || objectType), templateMapper);
|
|
63393
|
+
const isOptional = getMappedTypeOptionality(objectType) > 0 || (isGenericType(objectType) ? getCombinedMappedTypeOptionality(getModifiersTypeFromMappedType(objectType)) > 0 : couldAccessOptionalProperty(objectType, index));
|
|
63378
63394
|
return addOptionality(
|
|
63379
63395
|
instantiatedTemplateType,
|
|
63380
63396
|
/*isProperty*/
|
|
63381
63397
|
true,
|
|
63382
|
-
|
|
63398
|
+
isOptional
|
|
63383
63399
|
);
|
|
63384
63400
|
}
|
|
63401
|
+
function couldAccessOptionalProperty(objectType, indexType) {
|
|
63402
|
+
const indexConstraint = getBaseConstraintOfType(indexType);
|
|
63403
|
+
return !!indexConstraint && some(getPropertiesOfType(objectType), (p) => !!(p.flags & 16777216 /* Optional */) && isTypeAssignableTo(getLiteralTypeFromProperty(p, 8576 /* StringOrNumberLiteralOrUnique */), indexConstraint));
|
|
63404
|
+
}
|
|
63385
63405
|
function getIndexedAccessType(objectType, indexType, accessFlags = 0 /* None */, accessNode, aliasSymbol, aliasTypeArguments) {
|
|
63386
63406
|
return getIndexedAccessTypeOrUndefined(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType);
|
|
63387
63407
|
}
|
|
@@ -65710,6 +65730,7 @@ function createTypeChecker(host) {
|
|
|
65710
65730
|
const result = isRelatedTo(
|
|
65711
65731
|
source,
|
|
65712
65732
|
target,
|
|
65733
|
+
0 /* None */,
|
|
65713
65734
|
3 /* Both */,
|
|
65714
65735
|
/*reportErrors*/
|
|
65715
65736
|
!!errorNode,
|
|
@@ -65993,10 +66014,7 @@ function createTypeChecker(host) {
|
|
|
65993
66014
|
}
|
|
65994
66015
|
return true;
|
|
65995
66016
|
}
|
|
65996
|
-
function
|
|
65997
|
-
return isRelatedTo(source2, target2, 3 /* Both */, reportErrors2);
|
|
65998
|
-
}
|
|
65999
|
-
function isRelatedTo(originalSource, originalTarget, recursionFlags = 3 /* Both */, reportErrors2 = false, headMessage2, intersectionState = 0 /* None */) {
|
|
66017
|
+
function isRelatedTo(originalSource, originalTarget, intersectionState, recursionFlags = 3 /* Both */, reportErrors2 = false, headMessage2) {
|
|
66000
66018
|
if (originalSource === originalTarget)
|
|
66001
66019
|
return -1 /* True */;
|
|
66002
66020
|
if (originalSource.flags & 524288 /* Object */ && originalTarget.flags & 402784252 /* Primitive */) {
|
|
@@ -66056,7 +66074,7 @@ function createTypeChecker(host) {
|
|
|
66056
66074
|
if (source2.flags & 469499904 /* StructuredOrInstantiable */ || target2.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
66057
66075
|
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */);
|
|
66058
66076
|
if (isPerformingExcessPropertyChecks) {
|
|
66059
|
-
if (hasExcessProperties(source2, target2, reportErrors2)) {
|
|
66077
|
+
if (hasExcessProperties(source2, target2, reportErrors2, intersectionState)) {
|
|
66060
66078
|
if (reportErrors2) {
|
|
66061
66079
|
reportRelationError(headMessage2, source2, originalTarget.aliasSymbol ? originalTarget : target2);
|
|
66062
66080
|
}
|
|
@@ -66074,12 +66092,14 @@ function createTypeChecker(host) {
|
|
|
66074
66092
|
if (calls.length > 0 && isRelatedTo(
|
|
66075
66093
|
getReturnTypeOfSignature(calls[0]),
|
|
66076
66094
|
target2,
|
|
66095
|
+
intersectionState,
|
|
66077
66096
|
1 /* Source */,
|
|
66078
66097
|
/*reportErrors*/
|
|
66079
66098
|
false
|
|
66080
66099
|
) || constructs.length > 0 && isRelatedTo(
|
|
66081
66100
|
getReturnTypeOfSignature(constructs[0]),
|
|
66082
66101
|
target2,
|
|
66102
|
+
intersectionState,
|
|
66083
66103
|
1 /* Source */,
|
|
66084
66104
|
/*reportErrors*/
|
|
66085
66105
|
false
|
|
@@ -66192,7 +66212,7 @@ function createTypeChecker(host) {
|
|
|
66192
66212
|
void 0
|
|
66193
66213
|
) || emptyArray);
|
|
66194
66214
|
}
|
|
66195
|
-
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
66215
|
+
function hasExcessProperties(source2, target2, reportErrors2, intersectionState) {
|
|
66196
66216
|
var _a2;
|
|
66197
66217
|
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 4096 /* JSLiteral */) {
|
|
66198
66218
|
return false;
|
|
@@ -66204,7 +66224,11 @@ function createTypeChecker(host) {
|
|
|
66204
66224
|
let reducedTarget = target2;
|
|
66205
66225
|
let checkTypes;
|
|
66206
66226
|
if (target2.flags & 1048576 /* Union */) {
|
|
66207
|
-
|
|
66227
|
+
let isRelatedToWorker2 = function(source3, target3) {
|
|
66228
|
+
return isRelatedTo(source3, target3, intersectionState);
|
|
66229
|
+
};
|
|
66230
|
+
var isRelatedToWorker = isRelatedToWorker2;
|
|
66231
|
+
reducedTarget = findMatchingDiscriminantType(source2, target2, isRelatedToWorker2) || filterPrimitivesIfContainsNonPrimitive(target2);
|
|
66208
66232
|
checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget];
|
|
66209
66233
|
}
|
|
66210
66234
|
for (const prop of getPropertiesOfType(source2)) {
|
|
@@ -66247,7 +66271,7 @@ function createTypeChecker(host) {
|
|
|
66247
66271
|
}
|
|
66248
66272
|
return true;
|
|
66249
66273
|
}
|
|
66250
|
-
if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), 3 /* Both */, reportErrors2)) {
|
|
66274
|
+
if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), intersectionState, 3 /* Both */, reportErrors2)) {
|
|
66251
66275
|
if (reportErrors2) {
|
|
66252
66276
|
reportIncompatibleError(Diagnostics.Types_of_property_0_are_incompatible, symbolToString(prop));
|
|
66253
66277
|
}
|
|
@@ -66291,12 +66315,14 @@ function createTypeChecker(host) {
|
|
|
66291
66315
|
return isRelatedTo(
|
|
66292
66316
|
source2,
|
|
66293
66317
|
target2,
|
|
66318
|
+
intersectionState,
|
|
66294
66319
|
1 /* Source */,
|
|
66295
66320
|
/*reportErrors*/
|
|
66296
66321
|
false
|
|
66297
66322
|
) || isRelatedTo(
|
|
66298
66323
|
target2,
|
|
66299
66324
|
source2,
|
|
66325
|
+
intersectionState,
|
|
66300
66326
|
1 /* Source */,
|
|
66301
66327
|
/*reportErrors*/
|
|
66302
66328
|
false
|
|
@@ -66312,7 +66338,7 @@ function createTypeChecker(host) {
|
|
|
66312
66338
|
1 /* Source */
|
|
66313
66339
|
);
|
|
66314
66340
|
}
|
|
66315
|
-
function eachTypeRelatedToSomeType(source2, target2) {
|
|
66341
|
+
function eachTypeRelatedToSomeType(source2, target2, intersectionState) {
|
|
66316
66342
|
let result2 = -1 /* True */;
|
|
66317
66343
|
const sourceTypes = source2.types;
|
|
66318
66344
|
for (const sourceType of sourceTypes) {
|
|
@@ -66321,7 +66347,7 @@ function createTypeChecker(host) {
|
|
|
66321
66347
|
target2,
|
|
66322
66348
|
/*reportErrors*/
|
|
66323
66349
|
false,
|
|
66324
|
-
|
|
66350
|
+
intersectionState
|
|
66325
66351
|
);
|
|
66326
66352
|
if (!related) {
|
|
66327
66353
|
return 0 /* False */;
|
|
@@ -66346,12 +66372,12 @@ function createTypeChecker(host) {
|
|
|
66346
66372
|
const related = isRelatedTo(
|
|
66347
66373
|
source2,
|
|
66348
66374
|
match,
|
|
66375
|
+
intersectionState,
|
|
66349
66376
|
2 /* Target */,
|
|
66350
66377
|
/*reportErrors*/
|
|
66351
66378
|
false,
|
|
66352
66379
|
/*headMessage*/
|
|
66353
|
-
void 0
|
|
66354
|
-
intersectionState
|
|
66380
|
+
void 0
|
|
66355
66381
|
);
|
|
66356
66382
|
if (related) {
|
|
66357
66383
|
return related;
|
|
@@ -66362,29 +66388,31 @@ function createTypeChecker(host) {
|
|
|
66362
66388
|
const related = isRelatedTo(
|
|
66363
66389
|
source2,
|
|
66364
66390
|
type,
|
|
66391
|
+
intersectionState,
|
|
66365
66392
|
2 /* Target */,
|
|
66366
66393
|
/*reportErrors*/
|
|
66367
66394
|
false,
|
|
66368
66395
|
/*headMessage*/
|
|
66369
|
-
void 0
|
|
66370
|
-
intersectionState
|
|
66396
|
+
void 0
|
|
66371
66397
|
);
|
|
66372
66398
|
if (related) {
|
|
66373
66399
|
return related;
|
|
66374
66400
|
}
|
|
66375
66401
|
}
|
|
66376
66402
|
if (reportErrors2) {
|
|
66377
|
-
|
|
66403
|
+
let isRelatedToWorker2 = function(source3, target3) {
|
|
66404
|
+
return isRelatedTo(source3, target3, intersectionState);
|
|
66405
|
+
};
|
|
66406
|
+
var isRelatedToWorker = isRelatedToWorker2;
|
|
66407
|
+
const bestMatchingType = getBestMatchingType(source2, target2, isRelatedToWorker2);
|
|
66378
66408
|
if (bestMatchingType) {
|
|
66379
66409
|
isRelatedTo(
|
|
66380
66410
|
source2,
|
|
66381
66411
|
bestMatchingType,
|
|
66412
|
+
intersectionState,
|
|
66382
66413
|
2 /* Target */,
|
|
66383
66414
|
/*reportErrors*/
|
|
66384
|
-
true
|
|
66385
|
-
/*headMessage*/
|
|
66386
|
-
void 0,
|
|
66387
|
-
intersectionState
|
|
66415
|
+
true
|
|
66388
66416
|
);
|
|
66389
66417
|
}
|
|
66390
66418
|
}
|
|
@@ -66397,11 +66425,11 @@ function createTypeChecker(host) {
|
|
|
66397
66425
|
const related = isRelatedTo(
|
|
66398
66426
|
source2,
|
|
66399
66427
|
targetType,
|
|
66428
|
+
intersectionState,
|
|
66400
66429
|
2 /* Target */,
|
|
66401
66430
|
reportErrors2,
|
|
66402
66431
|
/*headMessage*/
|
|
66403
|
-
void 0
|
|
66404
|
-
intersectionState
|
|
66432
|
+
void 0
|
|
66405
66433
|
);
|
|
66406
66434
|
if (!related) {
|
|
66407
66435
|
return 0 /* False */;
|
|
@@ -66420,11 +66448,11 @@ function createTypeChecker(host) {
|
|
|
66420
66448
|
const related = isRelatedTo(
|
|
66421
66449
|
sourceTypes[i],
|
|
66422
66450
|
target2,
|
|
66451
|
+
intersectionState,
|
|
66423
66452
|
1 /* Source */,
|
|
66424
66453
|
reportErrors2 && i === len - 1,
|
|
66425
66454
|
/*headMessage*/
|
|
66426
|
-
void 0
|
|
66427
|
-
intersectionState
|
|
66455
|
+
void 0
|
|
66428
66456
|
);
|
|
66429
66457
|
if (related) {
|
|
66430
66458
|
return related;
|
|
@@ -66448,12 +66476,12 @@ function createTypeChecker(host) {
|
|
|
66448
66476
|
const related2 = isRelatedTo(
|
|
66449
66477
|
sourceType,
|
|
66450
66478
|
undefinedStrippedTarget.types[i % undefinedStrippedTarget.types.length],
|
|
66479
|
+
intersectionState,
|
|
66451
66480
|
3 /* Both */,
|
|
66452
66481
|
/*reportErrors*/
|
|
66453
66482
|
false,
|
|
66454
66483
|
/*headMessage*/
|
|
66455
|
-
void 0
|
|
66456
|
-
intersectionState
|
|
66484
|
+
void 0
|
|
66457
66485
|
);
|
|
66458
66486
|
if (related2) {
|
|
66459
66487
|
result2 &= related2;
|
|
@@ -66463,11 +66491,11 @@ function createTypeChecker(host) {
|
|
|
66463
66491
|
const related = isRelatedTo(
|
|
66464
66492
|
sourceType,
|
|
66465
66493
|
target2,
|
|
66494
|
+
intersectionState,
|
|
66466
66495
|
1 /* Source */,
|
|
66467
66496
|
reportErrors2,
|
|
66468
66497
|
/*headMessage*/
|
|
66469
|
-
void 0
|
|
66470
|
-
intersectionState
|
|
66498
|
+
void 0
|
|
66471
66499
|
);
|
|
66472
66500
|
if (!related) {
|
|
66473
66501
|
return 0 /* False */;
|
|
@@ -66493,6 +66521,7 @@ function createTypeChecker(host) {
|
|
|
66493
66521
|
related = relation === identityRelation ? isRelatedTo(
|
|
66494
66522
|
s,
|
|
66495
66523
|
t,
|
|
66524
|
+
intersectionState,
|
|
66496
66525
|
3 /* Both */,
|
|
66497
66526
|
/*reportErrors*/
|
|
66498
66527
|
false
|
|
@@ -66501,26 +66530,27 @@ function createTypeChecker(host) {
|
|
|
66501
66530
|
related = isRelatedTo(
|
|
66502
66531
|
s,
|
|
66503
66532
|
t,
|
|
66533
|
+
intersectionState,
|
|
66504
66534
|
3 /* Both */,
|
|
66505
66535
|
reportErrors2,
|
|
66506
66536
|
/*headMessage*/
|
|
66507
|
-
void 0
|
|
66508
|
-
intersectionState
|
|
66537
|
+
void 0
|
|
66509
66538
|
);
|
|
66510
66539
|
} else if (variance === 2 /* Contravariant */) {
|
|
66511
66540
|
related = isRelatedTo(
|
|
66512
66541
|
t,
|
|
66513
66542
|
s,
|
|
66543
|
+
intersectionState,
|
|
66514
66544
|
3 /* Both */,
|
|
66515
66545
|
reportErrors2,
|
|
66516
66546
|
/*headMessage*/
|
|
66517
|
-
void 0
|
|
66518
|
-
intersectionState
|
|
66547
|
+
void 0
|
|
66519
66548
|
);
|
|
66520
66549
|
} else if (variance === 3 /* Bivariant */) {
|
|
66521
66550
|
related = isRelatedTo(
|
|
66522
66551
|
t,
|
|
66523
66552
|
s,
|
|
66553
|
+
intersectionState,
|
|
66524
66554
|
3 /* Both */,
|
|
66525
66555
|
/*reportErrors*/
|
|
66526
66556
|
false
|
|
@@ -66529,32 +66559,32 @@ function createTypeChecker(host) {
|
|
|
66529
66559
|
related = isRelatedTo(
|
|
66530
66560
|
s,
|
|
66531
66561
|
t,
|
|
66562
|
+
intersectionState,
|
|
66532
66563
|
3 /* Both */,
|
|
66533
66564
|
reportErrors2,
|
|
66534
66565
|
/*headMessage*/
|
|
66535
|
-
void 0
|
|
66536
|
-
intersectionState
|
|
66566
|
+
void 0
|
|
66537
66567
|
);
|
|
66538
66568
|
}
|
|
66539
66569
|
} else {
|
|
66540
66570
|
related = isRelatedTo(
|
|
66541
66571
|
s,
|
|
66542
66572
|
t,
|
|
66573
|
+
intersectionState,
|
|
66543
66574
|
3 /* Both */,
|
|
66544
66575
|
reportErrors2,
|
|
66545
66576
|
/*headMessage*/
|
|
66546
|
-
void 0
|
|
66547
|
-
intersectionState
|
|
66577
|
+
void 0
|
|
66548
66578
|
);
|
|
66549
66579
|
if (related) {
|
|
66550
66580
|
related &= isRelatedTo(
|
|
66551
66581
|
t,
|
|
66552
66582
|
s,
|
|
66583
|
+
intersectionState,
|
|
66553
66584
|
3 /* Both */,
|
|
66554
66585
|
reportErrors2,
|
|
66555
66586
|
/*headMessage*/
|
|
66556
|
-
void 0
|
|
66557
|
-
intersectionState
|
|
66587
|
+
void 0
|
|
66558
66588
|
);
|
|
66559
66589
|
}
|
|
66560
66590
|
}
|
|
@@ -66720,12 +66750,12 @@ function createTypeChecker(host) {
|
|
|
66720
66750
|
result2 = isRelatedTo(
|
|
66721
66751
|
constraint,
|
|
66722
66752
|
target2,
|
|
66753
|
+
intersectionState,
|
|
66723
66754
|
1 /* Source */,
|
|
66724
66755
|
/*reportErrors*/
|
|
66725
66756
|
false,
|
|
66726
66757
|
/*headMessage*/
|
|
66727
|
-
void 0
|
|
66728
|
-
intersectionState
|
|
66758
|
+
void 0
|
|
66729
66759
|
);
|
|
66730
66760
|
}
|
|
66731
66761
|
}
|
|
@@ -66788,9 +66818,9 @@ function createTypeChecker(host) {
|
|
|
66788
66818
|
const targetFlags = target2.flags;
|
|
66789
66819
|
if (relation === identityRelation) {
|
|
66790
66820
|
if (sourceFlags & 3145728 /* UnionOrIntersection */) {
|
|
66791
|
-
let result3 = eachTypeRelatedToSomeType(source2, target2);
|
|
66821
|
+
let result3 = eachTypeRelatedToSomeType(source2, target2, intersectionState);
|
|
66792
66822
|
if (result3) {
|
|
66793
|
-
result3 &= eachTypeRelatedToSomeType(target2, source2);
|
|
66823
|
+
result3 &= eachTypeRelatedToSomeType(target2, source2, intersectionState);
|
|
66794
66824
|
}
|
|
66795
66825
|
return result3;
|
|
66796
66826
|
}
|
|
@@ -66798,6 +66828,7 @@ function createTypeChecker(host) {
|
|
|
66798
66828
|
return isRelatedTo(
|
|
66799
66829
|
source2.type,
|
|
66800
66830
|
target2.type,
|
|
66831
|
+
intersectionState,
|
|
66801
66832
|
3 /* Both */,
|
|
66802
66833
|
/*reportErrors*/
|
|
66803
66834
|
false
|
|
@@ -66807,6 +66838,7 @@ function createTypeChecker(host) {
|
|
|
66807
66838
|
if (result2 = isRelatedTo(
|
|
66808
66839
|
source2.objectType,
|
|
66809
66840
|
target2.objectType,
|
|
66841
|
+
intersectionState,
|
|
66810
66842
|
3 /* Both */,
|
|
66811
66843
|
/*reportErrors*/
|
|
66812
66844
|
false
|
|
@@ -66814,6 +66846,7 @@ function createTypeChecker(host) {
|
|
|
66814
66846
|
if (result2 &= isRelatedTo(
|
|
66815
66847
|
source2.indexType,
|
|
66816
66848
|
target2.indexType,
|
|
66849
|
+
intersectionState,
|
|
66817
66850
|
3 /* Both */,
|
|
66818
66851
|
/*reportErrors*/
|
|
66819
66852
|
false
|
|
@@ -66827,6 +66860,7 @@ function createTypeChecker(host) {
|
|
|
66827
66860
|
if (result2 = isRelatedTo(
|
|
66828
66861
|
source2.checkType,
|
|
66829
66862
|
target2.checkType,
|
|
66863
|
+
intersectionState,
|
|
66830
66864
|
3 /* Both */,
|
|
66831
66865
|
/*reportErrors*/
|
|
66832
66866
|
false
|
|
@@ -66834,6 +66868,7 @@ function createTypeChecker(host) {
|
|
|
66834
66868
|
if (result2 &= isRelatedTo(
|
|
66835
66869
|
source2.extendsType,
|
|
66836
66870
|
target2.extendsType,
|
|
66871
|
+
intersectionState,
|
|
66837
66872
|
3 /* Both */,
|
|
66838
66873
|
/*reportErrors*/
|
|
66839
66874
|
false
|
|
@@ -66841,6 +66876,7 @@ function createTypeChecker(host) {
|
|
|
66841
66876
|
if (result2 &= isRelatedTo(
|
|
66842
66877
|
getTrueTypeFromConditionalType(source2),
|
|
66843
66878
|
getTrueTypeFromConditionalType(target2),
|
|
66879
|
+
intersectionState,
|
|
66844
66880
|
3 /* Both */,
|
|
66845
66881
|
/*reportErrors*/
|
|
66846
66882
|
false
|
|
@@ -66848,6 +66884,7 @@ function createTypeChecker(host) {
|
|
|
66848
66884
|
if (result2 &= isRelatedTo(
|
|
66849
66885
|
getFalseTypeFromConditionalType(source2),
|
|
66850
66886
|
getFalseTypeFromConditionalType(target2),
|
|
66887
|
+
intersectionState,
|
|
66851
66888
|
3 /* Both */,
|
|
66852
66889
|
/*reportErrors*/
|
|
66853
66890
|
false
|
|
@@ -66863,6 +66900,7 @@ function createTypeChecker(host) {
|
|
|
66863
66900
|
if (result2 = isRelatedTo(
|
|
66864
66901
|
source2.baseType,
|
|
66865
66902
|
target2.baseType,
|
|
66903
|
+
intersectionState,
|
|
66866
66904
|
3 /* Both */,
|
|
66867
66905
|
/*reportErrors*/
|
|
66868
66906
|
false
|
|
@@ -66870,6 +66908,7 @@ function createTypeChecker(host) {
|
|
|
66870
66908
|
if (result2 &= isRelatedTo(
|
|
66871
66909
|
source2.constraint,
|
|
66872
66910
|
target2.constraint,
|
|
66911
|
+
intersectionState,
|
|
66873
66912
|
3 /* Both */,
|
|
66874
66913
|
/*reportErrors*/
|
|
66875
66914
|
false
|
|
@@ -66903,15 +66942,15 @@ function createTypeChecker(host) {
|
|
|
66903
66942
|
return varianceResult;
|
|
66904
66943
|
}
|
|
66905
66944
|
}
|
|
66906
|
-
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 */))) {
|
|
66945
|
+
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 */))) {
|
|
66907
66946
|
return result2;
|
|
66908
66947
|
}
|
|
66909
66948
|
if (targetFlags & 262144 /* TypeParameter */) {
|
|
66910
|
-
if (getObjectFlags(source2) & 32 /* Mapped */ && !source2.declaration.nameType && isRelatedTo(getIndexType(target2), getConstraintTypeFromMappedType(source2), 3 /* Both */)) {
|
|
66949
|
+
if (getObjectFlags(source2) & 32 /* Mapped */ && !source2.declaration.nameType && isRelatedTo(getIndexType(target2), getConstraintTypeFromMappedType(source2), intersectionState, 3 /* Both */)) {
|
|
66911
66950
|
if (!(getMappedTypeModifiers(source2) & 4 /* IncludeOptional */)) {
|
|
66912
66951
|
const templateType = getTemplateTypeFromMappedType(source2);
|
|
66913
66952
|
const indexedAccessType = getIndexedAccessType(target2, getTypeParameterFromMappedType(source2));
|
|
66914
|
-
if (result2 = isRelatedTo(templateType, indexedAccessType, 3 /* Both */, reportErrors2)) {
|
|
66953
|
+
if (result2 = isRelatedTo(templateType, indexedAccessType, intersectionState, 3 /* Both */, reportErrors2)) {
|
|
66915
66954
|
return result2;
|
|
66916
66955
|
}
|
|
66917
66956
|
}
|
|
@@ -66923,6 +66962,7 @@ function createTypeChecker(host) {
|
|
|
66923
66962
|
if (result2 = isRelatedTo(
|
|
66924
66963
|
constraint,
|
|
66925
66964
|
target2,
|
|
66965
|
+
intersectionState,
|
|
66926
66966
|
1 /* Source */,
|
|
66927
66967
|
/*reportErrors*/
|
|
66928
66968
|
false
|
|
@@ -66940,6 +66980,7 @@ function createTypeChecker(host) {
|
|
|
66940
66980
|
if (result2 = isRelatedTo(
|
|
66941
66981
|
targetType,
|
|
66942
66982
|
source2.type,
|
|
66983
|
+
intersectionState,
|
|
66943
66984
|
3 /* Both */,
|
|
66944
66985
|
/*reportErrors*/
|
|
66945
66986
|
false
|
|
@@ -66948,13 +66989,13 @@ function createTypeChecker(host) {
|
|
|
66948
66989
|
}
|
|
66949
66990
|
}
|
|
66950
66991
|
if (isTupleType(targetType)) {
|
|
66951
|
-
if (result2 = isRelatedTo(source2, getKnownKeysOfTupleType(targetType), 2 /* Target */, reportErrors2)) {
|
|
66992
|
+
if (result2 = isRelatedTo(source2, getKnownKeysOfTupleType(targetType), intersectionState, 2 /* Target */, reportErrors2)) {
|
|
66952
66993
|
return result2;
|
|
66953
66994
|
}
|
|
66954
66995
|
} else {
|
|
66955
66996
|
const constraint = getSimplifiedTypeOrConstraint(targetType);
|
|
66956
66997
|
if (constraint) {
|
|
66957
|
-
if (isRelatedTo(source2, getIndexType(constraint, target2.indexFlags | 4 /* NoReducibleCheck */), 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
66998
|
+
if (isRelatedTo(source2, getIndexType(constraint, target2.indexFlags | 4 /* NoReducibleCheck */), intersectionState, 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
66958
66999
|
return -1 /* True */;
|
|
66959
67000
|
}
|
|
66960
67001
|
} else if (isGenericMappedType(targetType)) {
|
|
@@ -66967,15 +67008,15 @@ function createTypeChecker(host) {
|
|
|
66967
67008
|
} else {
|
|
66968
67009
|
targetKeys = nameType || constraintType;
|
|
66969
67010
|
}
|
|
66970
|
-
if (isRelatedTo(source2, targetKeys, 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
67011
|
+
if (isRelatedTo(source2, targetKeys, intersectionState, 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
66971
67012
|
return -1 /* True */;
|
|
66972
67013
|
}
|
|
66973
67014
|
}
|
|
66974
67015
|
}
|
|
66975
67016
|
} else if (targetFlags & 8388608 /* IndexedAccess */) {
|
|
66976
67017
|
if (sourceFlags & 8388608 /* IndexedAccess */) {
|
|
66977
|
-
if (result2 = isRelatedTo(source2.objectType, target2.objectType, 3 /* Both */, reportErrors2)) {
|
|
66978
|
-
result2 &= isRelatedTo(source2.indexType, target2.indexType, 3 /* Both */, reportErrors2);
|
|
67018
|
+
if (result2 = isRelatedTo(source2.objectType, target2.objectType, intersectionState, 3 /* Both */, reportErrors2)) {
|
|
67019
|
+
result2 &= isRelatedTo(source2.indexType, target2.indexType, intersectionState, 3 /* Both */, reportErrors2);
|
|
66979
67020
|
}
|
|
66980
67021
|
if (result2) {
|
|
66981
67022
|
return result2;
|
|
@@ -66999,11 +67040,11 @@ function createTypeChecker(host) {
|
|
|
66999
67040
|
if (result2 = isRelatedTo(
|
|
67000
67041
|
source2,
|
|
67001
67042
|
constraint,
|
|
67043
|
+
intersectionState,
|
|
67002
67044
|
2 /* Target */,
|
|
67003
67045
|
reportErrors2,
|
|
67004
67046
|
/*headMessage*/
|
|
67005
|
-
void 0
|
|
67006
|
-
intersectionState
|
|
67047
|
+
void 0
|
|
67007
67048
|
)) {
|
|
67008
67049
|
return result2;
|
|
67009
67050
|
}
|
|
@@ -67029,18 +67070,18 @@ function createTypeChecker(host) {
|
|
|
67029
67070
|
const sourceKeys = getIndexType(source2, 2 /* NoIndexSignatures */);
|
|
67030
67071
|
const includeOptional = modifiers & 4 /* IncludeOptional */;
|
|
67031
67072
|
const filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : void 0;
|
|
67032
|
-
if (includeOptional ? !(filteredByApplicability.flags & 131072 /* Never */) : isRelatedTo(targetKeys, sourceKeys, 3 /* Both */)) {
|
|
67073
|
+
if (includeOptional ? !(filteredByApplicability.flags & 131072 /* Never */) : isRelatedTo(targetKeys, sourceKeys, intersectionState, 3 /* Both */)) {
|
|
67033
67074
|
const templateType2 = getTemplateTypeFromMappedType(target2);
|
|
67034
67075
|
const typeParameter = getTypeParameterFromMappedType(target2);
|
|
67035
67076
|
const nonNullComponent = extractTypesOfKind(templateType2, ~98304 /* Nullable */);
|
|
67036
67077
|
if (!keysRemapped && nonNullComponent.flags & 8388608 /* IndexedAccess */ && nonNullComponent.indexType === typeParameter) {
|
|
67037
|
-
if (result2 = isRelatedTo(source2, nonNullComponent.objectType, 2 /* Target */, reportErrors2)) {
|
|
67078
|
+
if (result2 = isRelatedTo(source2, nonNullComponent.objectType, intersectionState, 2 /* Target */, reportErrors2)) {
|
|
67038
67079
|
return result2;
|
|
67039
67080
|
}
|
|
67040
67081
|
} else {
|
|
67041
67082
|
const indexingType = keysRemapped ? filteredByApplicability || targetKeys : filteredByApplicability ? getIntersectionType([filteredByApplicability, typeParameter]) : typeParameter;
|
|
67042
67083
|
const indexedAccessType = getIndexedAccessType(source2, indexingType);
|
|
67043
|
-
if (result2 = isRelatedTo(indexedAccessType, templateType2, 3 /* Both */, reportErrors2)) {
|
|
67084
|
+
if (result2 = isRelatedTo(indexedAccessType, templateType2, intersectionState, 3 /* Both */, reportErrors2)) {
|
|
67044
67085
|
return result2;
|
|
67045
67086
|
}
|
|
67046
67087
|
}
|
|
@@ -67060,22 +67101,22 @@ function createTypeChecker(host) {
|
|
|
67060
67101
|
if (result2 = skipTrue ? -1 /* True */ : isRelatedTo(
|
|
67061
67102
|
source2,
|
|
67062
67103
|
getTrueTypeFromConditionalType(c),
|
|
67104
|
+
intersectionState,
|
|
67063
67105
|
2 /* Target */,
|
|
67064
67106
|
/*reportErrors*/
|
|
67065
67107
|
false,
|
|
67066
67108
|
/*headMessage*/
|
|
67067
|
-
void 0
|
|
67068
|
-
intersectionState
|
|
67109
|
+
void 0
|
|
67069
67110
|
)) {
|
|
67070
67111
|
result2 &= skipFalse ? -1 /* True */ : isRelatedTo(
|
|
67071
67112
|
source2,
|
|
67072
67113
|
getFalseTypeFromConditionalType(c),
|
|
67114
|
+
intersectionState,
|
|
67073
67115
|
2 /* Target */,
|
|
67074
67116
|
/*reportErrors*/
|
|
67075
67117
|
false,
|
|
67076
67118
|
/*headMessage*/
|
|
67077
|
-
void 0
|
|
67078
|
-
intersectionState
|
|
67119
|
+
void 0
|
|
67079
67120
|
);
|
|
67080
67121
|
if (result2) {
|
|
67081
67122
|
return result2;
|
|
@@ -67105,29 +67146,29 @@ function createTypeChecker(host) {
|
|
|
67105
67146
|
if (result2 = isRelatedTo(
|
|
67106
67147
|
constraint,
|
|
67107
67148
|
target2,
|
|
67149
|
+
intersectionState,
|
|
67108
67150
|
1 /* Source */,
|
|
67109
67151
|
/*reportErrors*/
|
|
67110
67152
|
false,
|
|
67111
67153
|
/*headMessage*/
|
|
67112
|
-
void 0
|
|
67113
|
-
intersectionState
|
|
67154
|
+
void 0
|
|
67114
67155
|
)) {
|
|
67115
67156
|
return result2;
|
|
67116
67157
|
} else if (result2 = isRelatedTo(
|
|
67117
67158
|
getTypeWithThisArgument(constraint, source2),
|
|
67118
67159
|
target2,
|
|
67160
|
+
intersectionState,
|
|
67119
67161
|
1 /* Source */,
|
|
67120
67162
|
reportErrors2 && constraint !== unknownType && !(targetFlags & sourceFlags & 262144 /* TypeParameter */),
|
|
67121
67163
|
/*headMessage*/
|
|
67122
|
-
void 0
|
|
67123
|
-
intersectionState
|
|
67164
|
+
void 0
|
|
67124
67165
|
)) {
|
|
67125
67166
|
return result2;
|
|
67126
67167
|
}
|
|
67127
67168
|
if (isMappedTypeGenericIndexedAccess(source2)) {
|
|
67128
67169
|
const indexConstraint = getConstraintOfType(source2.indexType);
|
|
67129
67170
|
if (indexConstraint) {
|
|
67130
|
-
if (result2 = isRelatedTo(getIndexedAccessType(source2.objectType, indexConstraint), target2, 1 /* Source */, reportErrors2)) {
|
|
67171
|
+
if (result2 = isRelatedTo(getIndexedAccessType(source2.objectType, indexConstraint), target2, intersectionState, 1 /* Source */, reportErrors2)) {
|
|
67131
67172
|
return result2;
|
|
67132
67173
|
}
|
|
67133
67174
|
}
|
|
@@ -67135,21 +67176,21 @@ function createTypeChecker(host) {
|
|
|
67135
67176
|
}
|
|
67136
67177
|
} else if (sourceFlags & 4194304 /* Index */) {
|
|
67137
67178
|
const isDeferredMappedIndex = shouldDeferIndexType(source2.type, source2.indexFlags) && getObjectFlags(source2.type) & 32 /* Mapped */;
|
|
67138
|
-
if (result2 = isRelatedTo(stringNumberSymbolType, target2, 1 /* Source */, reportErrors2 && !isDeferredMappedIndex)) {
|
|
67179
|
+
if (result2 = isRelatedTo(stringNumberSymbolType, target2, intersectionState, 1 /* Source */, reportErrors2 && !isDeferredMappedIndex)) {
|
|
67139
67180
|
return result2;
|
|
67140
67181
|
}
|
|
67141
67182
|
if (isDeferredMappedIndex) {
|
|
67142
67183
|
const mappedType = source2.type;
|
|
67143
67184
|
const nameType = getNameTypeFromMappedType(mappedType);
|
|
67144
67185
|
const sourceMappedKeys = nameType && isMappedTypeWithKeyofConstraintDeclaration(mappedType) ? getApparentMappedTypeKeys(nameType, mappedType) : nameType || getConstraintTypeFromMappedType(mappedType);
|
|
67145
|
-
if (result2 = isRelatedTo(sourceMappedKeys, target2, 1 /* Source */, reportErrors2)) {
|
|
67186
|
+
if (result2 = isRelatedTo(sourceMappedKeys, target2, intersectionState, 1 /* Source */, reportErrors2)) {
|
|
67146
67187
|
return result2;
|
|
67147
67188
|
}
|
|
67148
67189
|
}
|
|
67149
67190
|
} else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
|
|
67150
67191
|
if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
|
|
67151
67192
|
const constraint = getBaseConstraintOfType(source2);
|
|
67152
|
-
if (constraint && constraint !== source2 && (result2 = isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2))) {
|
|
67193
|
+
if (constraint && constraint !== source2 && (result2 = isRelatedTo(constraint, target2, intersectionState, 1 /* Source */, reportErrors2))) {
|
|
67153
67194
|
return result2;
|
|
67154
67195
|
}
|
|
67155
67196
|
}
|
|
@@ -67158,12 +67199,12 @@ function createTypeChecker(host) {
|
|
|
67158
67199
|
if (source2.symbol !== target2.symbol) {
|
|
67159
67200
|
return 0 /* False */;
|
|
67160
67201
|
}
|
|
67161
|
-
if (result2 = isRelatedTo(source2.type, target2.type, 3 /* Both */, reportErrors2)) {
|
|
67202
|
+
if (result2 = isRelatedTo(source2.type, target2.type, intersectionState, 3 /* Both */, reportErrors2)) {
|
|
67162
67203
|
return result2;
|
|
67163
67204
|
}
|
|
67164
67205
|
} else {
|
|
67165
67206
|
const constraint = getBaseConstraintOfType(source2);
|
|
67166
|
-
if (constraint && (result2 = isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2))) {
|
|
67207
|
+
if (constraint && (result2 = isRelatedTo(constraint, target2, intersectionState, 1 /* Source */, reportErrors2))) {
|
|
67167
67208
|
return result2;
|
|
67168
67209
|
}
|
|
67169
67210
|
}
|
|
@@ -67176,20 +67217,24 @@ function createTypeChecker(host) {
|
|
|
67176
67217
|
let sourceExtends = source2.extendsType;
|
|
67177
67218
|
let mapper;
|
|
67178
67219
|
if (sourceParams) {
|
|
67220
|
+
let isRelatedToWorker2 = function(source3, target3, reportErrors3) {
|
|
67221
|
+
return isRelatedTo(source3, target3, 0 /* None */, 3 /* Both */, reportErrors3);
|
|
67222
|
+
};
|
|
67223
|
+
var isRelatedToWorker = isRelatedToWorker2;
|
|
67179
67224
|
const ctx = createInferenceContext(
|
|
67180
67225
|
sourceParams,
|
|
67181
67226
|
/*signature*/
|
|
67182
67227
|
void 0,
|
|
67183
67228
|
0 /* None */,
|
|
67184
|
-
|
|
67229
|
+
isRelatedToWorker2
|
|
67185
67230
|
);
|
|
67186
67231
|
inferTypes(ctx.inferences, target2.extendsType, sourceExtends, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
|
|
67187
67232
|
sourceExtends = instantiateType(sourceExtends, ctx.mapper);
|
|
67188
67233
|
mapper = ctx.mapper;
|
|
67189
67234
|
}
|
|
67190
|
-
if (isTypeIdenticalTo(sourceExtends, target2.extendsType) && (isRelatedTo(source2.checkType, target2.checkType, 3 /* Both */) || isRelatedTo(target2.checkType, source2.checkType, 3 /* Both */))) {
|
|
67191
|
-
if (result2 = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source2), mapper), getTrueTypeFromConditionalType(target2), 3 /* Both */, reportErrors2)) {
|
|
67192
|
-
result2 &= isRelatedTo(getFalseTypeFromConditionalType(source2), getFalseTypeFromConditionalType(target2), 3 /* Both */, reportErrors2);
|
|
67235
|
+
if (isTypeIdenticalTo(sourceExtends, target2.extendsType) && (isRelatedTo(source2.checkType, target2.checkType, intersectionState, 3 /* Both */) || isRelatedTo(target2.checkType, source2.checkType, intersectionState, 3 /* Both */))) {
|
|
67236
|
+
if (result2 = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source2), mapper), getTrueTypeFromConditionalType(target2), intersectionState, 3 /* Both */, reportErrors2)) {
|
|
67237
|
+
result2 &= isRelatedTo(getFalseTypeFromConditionalType(source2), getFalseTypeFromConditionalType(target2), intersectionState, 3 /* Both */, reportErrors2);
|
|
67193
67238
|
}
|
|
67194
67239
|
if (result2) {
|
|
67195
67240
|
return result2;
|
|
@@ -67198,14 +67243,14 @@ function createTypeChecker(host) {
|
|
|
67198
67243
|
}
|
|
67199
67244
|
const defaultConstraint = getDefaultConstraintOfConditionalType(source2);
|
|
67200
67245
|
if (defaultConstraint) {
|
|
67201
|
-
if (result2 = isRelatedTo(defaultConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
67246
|
+
if (result2 = isRelatedTo(defaultConstraint, target2, intersectionState, 1 /* Source */, reportErrors2)) {
|
|
67202
67247
|
return result2;
|
|
67203
67248
|
}
|
|
67204
67249
|
}
|
|
67205
67250
|
const distributiveConstraint = !(targetFlags & 16777216 /* Conditional */) && hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
|
|
67206
67251
|
if (distributiveConstraint) {
|
|
67207
67252
|
resetErrorInfo(saveErrorInfo);
|
|
67208
|
-
if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
67253
|
+
if (result2 = isRelatedTo(distributiveConstraint, target2, intersectionState, 1 /* Source */, reportErrors2)) {
|
|
67209
67254
|
return result2;
|
|
67210
67255
|
}
|
|
67211
67256
|
}
|
|
@@ -67215,7 +67260,7 @@ function createTypeChecker(host) {
|
|
|
67215
67260
|
}
|
|
67216
67261
|
if (isGenericMappedType(target2)) {
|
|
67217
67262
|
if (isGenericMappedType(source2)) {
|
|
67218
|
-
if (result2 = mappedTypeRelatedTo(source2, target2, reportErrors2)) {
|
|
67263
|
+
if (result2 = mappedTypeRelatedTo(source2, target2, reportErrors2, intersectionState)) {
|
|
67219
67264
|
return result2;
|
|
67220
67265
|
}
|
|
67221
67266
|
}
|
|
@@ -67242,14 +67287,14 @@ function createTypeChecker(host) {
|
|
|
67242
67287
|
}
|
|
67243
67288
|
} else if (isReadonlyArrayType(target2) ? everyType(source2, isArrayOrTupleType) : isArrayType(target2) && everyType(source2, (t) => isTupleType(t) && !t.target.readonly)) {
|
|
67244
67289
|
if (relation !== identityRelation) {
|
|
67245
|
-
return isRelatedTo(getIndexTypeOfType(source2, numberType) || anyType, getIndexTypeOfType(target2, numberType) || anyType, 3 /* Both */, reportErrors2);
|
|
67290
|
+
return isRelatedTo(getIndexTypeOfType(source2, numberType) || anyType, getIndexTypeOfType(target2, numberType) || anyType, intersectionState, 3 /* Both */, reportErrors2);
|
|
67246
67291
|
} else {
|
|
67247
67292
|
return 0 /* False */;
|
|
67248
67293
|
}
|
|
67249
67294
|
} else if (isGenericTupleType(source2) && isTupleType(target2) && !isGenericTupleType(target2)) {
|
|
67250
67295
|
const constraint = getBaseConstraintOrType(source2);
|
|
67251
67296
|
if (constraint !== source2) {
|
|
67252
|
-
return isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2);
|
|
67297
|
+
return isRelatedTo(constraint, target2, intersectionState, 1 /* Source */, reportErrors2);
|
|
67253
67298
|
}
|
|
67254
67299
|
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) & 8192 /* FreshLiteral */ && !isEmptyObjectType(source2)) {
|
|
67255
67300
|
return 0 /* False */;
|
|
@@ -67317,16 +67362,16 @@ function createTypeChecker(host) {
|
|
|
67317
67362
|
}
|
|
67318
67363
|
}
|
|
67319
67364
|
}
|
|
67320
|
-
function mappedTypeRelatedTo(source2, target2, reportErrors2) {
|
|
67365
|
+
function mappedTypeRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
67321
67366
|
const modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source2) === getMappedTypeModifiers(target2) : getCombinedMappedTypeOptionality(source2) <= getCombinedMappedTypeOptionality(target2));
|
|
67322
67367
|
if (modifiersRelated) {
|
|
67323
67368
|
let result2;
|
|
67324
67369
|
const targetConstraint = getConstraintTypeFromMappedType(target2);
|
|
67325
67370
|
const sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source2), getCombinedMappedTypeOptionality(source2) < 0 ? reportUnmeasurableMapper : reportUnreliableMapper);
|
|
67326
|
-
if (result2 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors2)) {
|
|
67371
|
+
if (result2 = isRelatedTo(targetConstraint, sourceConstraint, intersectionState, 3 /* Both */, reportErrors2)) {
|
|
67327
67372
|
const mapper = createTypeMapper([getTypeParameterFromMappedType(source2)], [getTypeParameterFromMappedType(target2)]);
|
|
67328
67373
|
if (instantiateType(getNameTypeFromMappedType(source2), mapper) === instantiateType(getNameTypeFromMappedType(target2), mapper)) {
|
|
67329
|
-
return result2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source2), mapper), getTemplateTypeFromMappedType(target2), 3 /* Both */, reportErrors2);
|
|
67374
|
+
return result2 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source2), mapper), getTemplateTypeFromMappedType(target2), intersectionState, 3 /* Both */, reportErrors2);
|
|
67330
67375
|
}
|
|
67331
67376
|
}
|
|
67332
67377
|
}
|
|
@@ -67466,11 +67511,11 @@ function createTypeChecker(host) {
|
|
|
67466
67511
|
return isRelatedTo(
|
|
67467
67512
|
effectiveSource,
|
|
67468
67513
|
effectiveTarget,
|
|
67514
|
+
intersectionState,
|
|
67469
67515
|
3 /* Both */,
|
|
67470
67516
|
reportErrors2,
|
|
67471
67517
|
/*headMessage*/
|
|
67472
|
-
void 0
|
|
67473
|
-
intersectionState
|
|
67518
|
+
void 0
|
|
67474
67519
|
);
|
|
67475
67520
|
}
|
|
67476
67521
|
function propertyRelatedTo(source2, target2, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState, skipOptional) {
|
|
@@ -67578,7 +67623,7 @@ function createTypeChecker(host) {
|
|
|
67578
67623
|
}
|
|
67579
67624
|
function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, optionalsOnly, intersectionState) {
|
|
67580
67625
|
if (relation === identityRelation) {
|
|
67581
|
-
return propertiesIdenticalTo(source2, target2, excludedProperties);
|
|
67626
|
+
return propertiesIdenticalTo(source2, target2, excludedProperties, intersectionState);
|
|
67582
67627
|
}
|
|
67583
67628
|
let result2 = -1 /* True */;
|
|
67584
67629
|
if (isTupleType(target2)) {
|
|
@@ -67657,11 +67702,11 @@ function createTypeChecker(host) {
|
|
|
67657
67702
|
const related = isRelatedTo(
|
|
67658
67703
|
sourceType,
|
|
67659
67704
|
targetCheckType,
|
|
67705
|
+
intersectionState,
|
|
67660
67706
|
3 /* Both */,
|
|
67661
67707
|
reportErrors2,
|
|
67662
67708
|
/*headMessage*/
|
|
67663
|
-
void 0
|
|
67664
|
-
intersectionState
|
|
67709
|
+
void 0
|
|
67665
67710
|
);
|
|
67666
67711
|
if (!related) {
|
|
67667
67712
|
if (reportErrors2 && (targetArity > 1 || sourceArity > 1)) {
|
|
@@ -67725,7 +67770,7 @@ function createTypeChecker(host) {
|
|
|
67725
67770
|
}
|
|
67726
67771
|
return result2;
|
|
67727
67772
|
}
|
|
67728
|
-
function propertiesIdenticalTo(source2, target2, excludedProperties) {
|
|
67773
|
+
function propertiesIdenticalTo(source2, target2, excludedProperties, intersectionState) {
|
|
67729
67774
|
if (!(source2.flags & 524288 /* Object */ && target2.flags & 524288 /* Object */)) {
|
|
67730
67775
|
return 0 /* False */;
|
|
67731
67776
|
}
|
|
@@ -67740,18 +67785,21 @@ function createTypeChecker(host) {
|
|
|
67740
67785
|
if (!targetProp) {
|
|
67741
67786
|
return 0 /* False */;
|
|
67742
67787
|
}
|
|
67743
|
-
const related = compareProperties2(sourceProp, targetProp,
|
|
67788
|
+
const related = compareProperties2(sourceProp, targetProp, isRelatedToWorker);
|
|
67744
67789
|
if (!related) {
|
|
67745
67790
|
return 0 /* False */;
|
|
67746
67791
|
}
|
|
67747
67792
|
result2 &= related;
|
|
67748
67793
|
}
|
|
67749
67794
|
return result2;
|
|
67795
|
+
function isRelatedToWorker(source3, target3) {
|
|
67796
|
+
return isRelatedTo(source3, target3, intersectionState);
|
|
67797
|
+
}
|
|
67750
67798
|
}
|
|
67751
67799
|
function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) {
|
|
67752
67800
|
var _a2, _b;
|
|
67753
67801
|
if (relation === identityRelation) {
|
|
67754
|
-
return signaturesIdenticalTo(source2, target2, kind);
|
|
67802
|
+
return signaturesIdenticalTo(source2, target2, kind, intersectionState);
|
|
67755
67803
|
}
|
|
67756
67804
|
if (target2 === anyFunctionType || source2 === anyFunctionType) {
|
|
67757
67805
|
return -1 /* True */;
|
|
@@ -67880,20 +67928,20 @@ function createTypeChecker(host) {
|
|
|
67880
67928
|
}
|
|
67881
67929
|
function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) {
|
|
67882
67930
|
const checkMode = relation === subtypeRelation ? 16 /* StrictTopSignature */ : relation === strictSubtypeRelation ? 16 /* StrictTopSignature */ | 8 /* StrictArity */ : 0 /* None */;
|
|
67883
|
-
return compareSignaturesRelated(erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, checkMode, reportErrors2, reportError, incompatibleReporter,
|
|
67884
|
-
function
|
|
67931
|
+
return compareSignaturesRelated(erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, checkMode, reportErrors2, reportError, incompatibleReporter, isRelatedToWorker, reportUnreliableMapper);
|
|
67932
|
+
function isRelatedToWorker(source3, target3, reportErrors3) {
|
|
67885
67933
|
return isRelatedTo(
|
|
67886
67934
|
source3,
|
|
67887
67935
|
target3,
|
|
67936
|
+
intersectionState,
|
|
67888
67937
|
3 /* Both */,
|
|
67889
67938
|
reportErrors3,
|
|
67890
67939
|
/*headMessage*/
|
|
67891
|
-
void 0
|
|
67892
|
-
intersectionState
|
|
67940
|
+
void 0
|
|
67893
67941
|
);
|
|
67894
67942
|
}
|
|
67895
67943
|
}
|
|
67896
|
-
function signaturesIdenticalTo(source2, target2, kind) {
|
|
67944
|
+
function signaturesIdenticalTo(source2, target2, kind, intersectionState) {
|
|
67897
67945
|
const sourceSignatures = getSignaturesOfType(source2, kind);
|
|
67898
67946
|
const targetSignatures = getSignaturesOfType(target2, kind);
|
|
67899
67947
|
if (sourceSignatures.length !== targetSignatures.length) {
|
|
@@ -67910,7 +67958,7 @@ function createTypeChecker(host) {
|
|
|
67910
67958
|
false,
|
|
67911
67959
|
/*ignoreReturnTypes*/
|
|
67912
67960
|
false,
|
|
67913
|
-
|
|
67961
|
+
isRelatedToWorker
|
|
67914
67962
|
);
|
|
67915
67963
|
if (!related) {
|
|
67916
67964
|
return 0 /* False */;
|
|
@@ -67918,6 +67966,9 @@ function createTypeChecker(host) {
|
|
|
67918
67966
|
result2 &= related;
|
|
67919
67967
|
}
|
|
67920
67968
|
return result2;
|
|
67969
|
+
function isRelatedToWorker(source3, target3) {
|
|
67970
|
+
return isRelatedTo(source3, target3, intersectionState);
|
|
67971
|
+
}
|
|
67921
67972
|
}
|
|
67922
67973
|
function membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState) {
|
|
67923
67974
|
let result2 = -1 /* True */;
|
|
@@ -67933,11 +67984,11 @@ function createTypeChecker(host) {
|
|
|
67933
67984
|
const related = isRelatedTo(
|
|
67934
67985
|
type,
|
|
67935
67986
|
targetInfo.type,
|
|
67987
|
+
intersectionState,
|
|
67936
67988
|
3 /* Both */,
|
|
67937
67989
|
reportErrors2,
|
|
67938
67990
|
/*headMessage*/
|
|
67939
|
-
void 0
|
|
67940
|
-
intersectionState
|
|
67991
|
+
void 0
|
|
67941
67992
|
);
|
|
67942
67993
|
if (!related) {
|
|
67943
67994
|
if (reportErrors2) {
|
|
@@ -67963,11 +68014,11 @@ function createTypeChecker(host) {
|
|
|
67963
68014
|
const related = isRelatedTo(
|
|
67964
68015
|
sourceInfo.type,
|
|
67965
68016
|
targetInfo.type,
|
|
68017
|
+
intersectionState,
|
|
67966
68018
|
3 /* Both */,
|
|
67967
68019
|
reportErrors2,
|
|
67968
68020
|
/*headMessage*/
|
|
67969
|
-
void 0
|
|
67970
|
-
intersectionState
|
|
68021
|
+
void 0
|
|
67971
68022
|
);
|
|
67972
68023
|
if (!related && reportErrors2) {
|
|
67973
68024
|
if (sourceInfo.keyType === targetInfo.keyType) {
|
|
@@ -67980,13 +68031,13 @@ function createTypeChecker(host) {
|
|
|
67980
68031
|
}
|
|
67981
68032
|
function indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportErrors2, intersectionState) {
|
|
67982
68033
|
if (relation === identityRelation) {
|
|
67983
|
-
return indexSignaturesIdenticalTo(source2, target2);
|
|
68034
|
+
return indexSignaturesIdenticalTo(source2, target2, intersectionState);
|
|
67984
68035
|
}
|
|
67985
68036
|
const indexInfos = getIndexInfosOfType(target2);
|
|
67986
68037
|
const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType);
|
|
67987
68038
|
let result2 = -1 /* True */;
|
|
67988
68039
|
for (const targetInfo of indexInfos) {
|
|
67989
|
-
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);
|
|
68040
|
+
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);
|
|
67990
68041
|
if (!related) {
|
|
67991
68042
|
return 0 /* False */;
|
|
67992
68043
|
}
|
|
@@ -68007,7 +68058,7 @@ function createTypeChecker(host) {
|
|
|
68007
68058
|
}
|
|
68008
68059
|
return 0 /* False */;
|
|
68009
68060
|
}
|
|
68010
|
-
function indexSignaturesIdenticalTo(source2, target2) {
|
|
68061
|
+
function indexSignaturesIdenticalTo(source2, target2, intersectionState) {
|
|
68011
68062
|
const sourceInfos = getIndexInfosOfType(source2);
|
|
68012
68063
|
const targetInfos = getIndexInfosOfType(target2);
|
|
68013
68064
|
if (sourceInfos.length !== targetInfos.length) {
|
|
@@ -68015,7 +68066,7 @@ function createTypeChecker(host) {
|
|
|
68015
68066
|
}
|
|
68016
68067
|
for (const targetInfo of targetInfos) {
|
|
68017
68068
|
const sourceInfo = getIndexInfoOfType(source2, targetInfo.keyType);
|
|
68018
|
-
if (!(sourceInfo && isRelatedTo(sourceInfo.type, targetInfo.type, 3 /* Both */) && sourceInfo.isReadonly === targetInfo.isReadonly)) {
|
|
68069
|
+
if (!(sourceInfo && isRelatedTo(sourceInfo.type, targetInfo.type, intersectionState, 3 /* Both */) && sourceInfo.isReadonly === targetInfo.isReadonly)) {
|
|
68019
68070
|
return 0 /* False */;
|
|
68020
68071
|
}
|
|
68021
68072
|
}
|
|
@@ -87953,20 +88004,7 @@ function createTypeChecker(host) {
|
|
|
87953
88004
|
if (!signatureDeclaration) {
|
|
87954
88005
|
return factory.createToken(133 /* AnyKeyword */);
|
|
87955
88006
|
}
|
|
87956
|
-
|
|
87957
|
-
const typePredicate = getTypePredicateOfSignature(signature);
|
|
87958
|
-
if (typePredicate) {
|
|
87959
|
-
return nodeBuilder.typePredicateToTypePredicateNode(typePredicate, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker);
|
|
87960
|
-
}
|
|
87961
|
-
return nodeBuilder.expressionOrTypeToTypeNode(
|
|
87962
|
-
getPossibleTypeNodeReuseExpression(signatureDeclaration),
|
|
87963
|
-
getReturnTypeOfSignature(signature),
|
|
87964
|
-
/*addUndefined*/
|
|
87965
|
-
void 0,
|
|
87966
|
-
enclosingDeclaration,
|
|
87967
|
-
flags | 1024 /* MultilineObjectLiterals */,
|
|
87968
|
-
tracker
|
|
87969
|
-
);
|
|
88007
|
+
return nodeBuilder.serializeReturnTypeForSignature(getSignatureFromDeclaration(signatureDeclaration), enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker);
|
|
87970
88008
|
}
|
|
87971
88009
|
function createTypeOfExpression(exprIn, enclosingDeclaration, flags, tracker) {
|
|
87972
88010
|
const expr = getParseTreeNode(exprIn, isExpression);
|
|
@@ -126998,7 +127036,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126998
127036
|
impliedFormatPackageJsons.delete(newFile.resolvedPath);
|
|
126999
127037
|
});
|
|
127000
127038
|
impliedFormatPackageJsons.forEach((existing, path) => {
|
|
127001
|
-
|
|
127039
|
+
const newFile = newProgram == null ? void 0 : newProgram.getSourceFileByPath(path);
|
|
127040
|
+
if (!newFile || newFile.resolvedPath !== path) {
|
|
127002
127041
|
existing.forEach((location) => fileWatchesOfAffectingLocations.get(location).files--);
|
|
127003
127042
|
impliedFormatPackageJsons.delete(path);
|
|
127004
127043
|
}
|