@typescript-deploys/pr-build 5.5.0-pr-58398-2 → 5.5.0-pr-58440-3
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 +85 -204
- package/lib/typescript.js +95 -208
- package/package.json +1 -1
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.20240505`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -16360,6 +16360,8 @@ function getAllAccessorDeclarations(declarations, accessor) {
|
|
|
16360
16360
|
function getEffectiveTypeAnnotationNode(node) {
|
|
16361
16361
|
if (!isInJSFile(node) && isFunctionDeclaration(node))
|
|
16362
16362
|
return void 0;
|
|
16363
|
+
if (isTypeAliasDeclaration(node))
|
|
16364
|
+
return void 0;
|
|
16363
16365
|
const type = node.type;
|
|
16364
16366
|
if (type || !isInJSFile(node))
|
|
16365
16367
|
return type;
|
|
@@ -56190,8 +56192,13 @@ function createTypeChecker(host) {
|
|
|
56190
56192
|
if (left.typeParameters && right.typeParameters) {
|
|
56191
56193
|
paramMapper = createTypeMapper(right.typeParameters, left.typeParameters);
|
|
56192
56194
|
}
|
|
56195
|
+
let flags = (left.flags | right.flags) & (167 /* PropagatingFlags */ & ~1 /* HasRestParameter */);
|
|
56193
56196
|
const declaration = left.declaration;
|
|
56194
56197
|
const params = combineUnionParameters(left, right, paramMapper);
|
|
56198
|
+
const lastParam = lastOrUndefined(params);
|
|
56199
|
+
if (lastParam && getCheckFlags(lastParam) & 32768 /* RestParameter */) {
|
|
56200
|
+
flags |= 1 /* HasRestParameter */;
|
|
56201
|
+
}
|
|
56195
56202
|
const thisParam = combineUnionThisParam(left.thisParameter, right.thisParameter, paramMapper);
|
|
56196
56203
|
const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount);
|
|
56197
56204
|
const result = createSignature(
|
|
@@ -56204,7 +56211,7 @@ function createTypeChecker(host) {
|
|
|
56204
56211
|
/*resolvedTypePredicate*/
|
|
56205
56212
|
void 0,
|
|
56206
56213
|
minArgCount,
|
|
56207
|
-
|
|
56214
|
+
flags
|
|
56208
56215
|
);
|
|
56209
56216
|
result.compositeKind = 1048576 /* Union */;
|
|
56210
56217
|
result.compositeSignatures = concatenate(left.compositeKind !== 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
|
|
@@ -56906,7 +56913,7 @@ function createTypeChecker(host) {
|
|
|
56906
56913
|
}
|
|
56907
56914
|
}
|
|
56908
56915
|
return getNormalizedType(
|
|
56909
|
-
getIntersectionType(constraints),
|
|
56916
|
+
getIntersectionType(constraints, 2 /* NoConstraintReduction */),
|
|
56910
56917
|
/*writing*/
|
|
56911
56918
|
false
|
|
56912
56919
|
);
|
|
@@ -59711,7 +59718,7 @@ function createTypeChecker(host) {
|
|
|
59711
59718
|
result.aliasTypeArguments = aliasTypeArguments;
|
|
59712
59719
|
return result;
|
|
59713
59720
|
}
|
|
59714
|
-
function getIntersectionType(types, aliasSymbol, aliasTypeArguments
|
|
59721
|
+
function getIntersectionType(types, flags = 0 /* None */, aliasSymbol, aliasTypeArguments) {
|
|
59715
59722
|
const typeMembershipMap = /* @__PURE__ */ new Map();
|
|
59716
59723
|
const includes = addTypesToIntersection(typeMembershipMap, 0, types);
|
|
59717
59724
|
const typeSet = arrayFrom(typeMembershipMap.values());
|
|
@@ -59732,7 +59739,7 @@ function createTypeChecker(host) {
|
|
|
59732
59739
|
return includes & 16777216 /* IncludesEmptyObject */ ? neverType : includes & 32768 /* Undefined */ ? undefinedType : nullType;
|
|
59733
59740
|
}
|
|
59734
59741
|
if (includes & 4 /* String */ && includes & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 8 /* Number */ && includes & 256 /* NumberLiteral */ || includes & 64 /* BigInt */ && includes & 2048 /* BigIntLiteral */ || includes & 4096 /* ESSymbol */ && includes & 8192 /* UniqueESSymbol */ || includes & 16384 /* Void */ && includes & 32768 /* Undefined */ || includes & 16777216 /* IncludesEmptyObject */ && includes & 470302716 /* DefinitelyNonNullable */) {
|
|
59735
|
-
if (!
|
|
59742
|
+
if (!(flags & 1 /* NoSupertypeReduction */))
|
|
59736
59743
|
removeRedundantSupertypes(typeSet, includes);
|
|
59737
59744
|
}
|
|
59738
59745
|
if (includes & 262144 /* IncludesMissingType */) {
|
|
@@ -59744,7 +59751,7 @@ function createTypeChecker(host) {
|
|
|
59744
59751
|
if (typeSet.length === 1) {
|
|
59745
59752
|
return typeSet[0];
|
|
59746
59753
|
}
|
|
59747
|
-
if (typeSet.length === 2) {
|
|
59754
|
+
if (typeSet.length === 2 && !(flags & 2 /* NoConstraintReduction */)) {
|
|
59748
59755
|
const typeVarIndex = typeSet[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
59749
59756
|
const typeVariable = typeSet[typeVarIndex];
|
|
59750
59757
|
const primitiveType = typeSet[1 - typeVarIndex];
|
|
@@ -59763,27 +59770,27 @@ function createTypeChecker(host) {
|
|
|
59763
59770
|
}
|
|
59764
59771
|
}
|
|
59765
59772
|
}
|
|
59766
|
-
const id = getTypeListId(typeSet) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
59773
|
+
const id = getTypeListId(typeSet) + (flags & 2 /* NoConstraintReduction */ ? "*" : getAliasId(aliasSymbol, aliasTypeArguments));
|
|
59767
59774
|
let result = intersectionTypes.get(id);
|
|
59768
59775
|
if (!result) {
|
|
59769
59776
|
if (includes & 1048576 /* Union */) {
|
|
59770
59777
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
59771
|
-
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
59778
|
+
result = getIntersectionType(typeSet, flags, aliasSymbol, aliasTypeArguments);
|
|
59772
59779
|
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) {
|
|
59773
59780
|
const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
|
|
59774
59781
|
removeFromEach(typeSet, 32768 /* Undefined */);
|
|
59775
|
-
result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
59782
|
+
result = getUnionType([getIntersectionType(typeSet, flags), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
59776
59783
|
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
|
|
59777
59784
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
59778
|
-
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
59785
|
+
result = getUnionType([getIntersectionType(typeSet, flags), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
59779
59786
|
} else if (typeSet.length >= 4) {
|
|
59780
59787
|
const middle = Math.floor(typeSet.length / 2);
|
|
59781
|
-
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments);
|
|
59788
|
+
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle), flags), getIntersectionType(typeSet.slice(middle), flags)], flags, aliasSymbol, aliasTypeArguments);
|
|
59782
59789
|
} else {
|
|
59783
59790
|
if (!checkCrossProductUnion(typeSet)) {
|
|
59784
59791
|
return errorType;
|
|
59785
59792
|
}
|
|
59786
|
-
const constituents = getCrossProductIntersections(typeSet);
|
|
59793
|
+
const constituents = getCrossProductIntersections(typeSet, flags);
|
|
59787
59794
|
const origin = some(constituents, (t) => !!(t.flags & 2097152 /* Intersection */)) && getConstituentCountOfTypes(constituents) > getConstituentCountOfTypes(typeSet) ? createOriginUnionOrIntersectionType(2097152 /* Intersection */, typeSet) : void 0;
|
|
59788
59795
|
result = getUnionType(constituents, 1 /* Literal */, aliasSymbol, aliasTypeArguments, origin);
|
|
59789
59796
|
}
|
|
@@ -59807,7 +59814,7 @@ function createTypeChecker(host) {
|
|
|
59807
59814
|
}
|
|
59808
59815
|
return true;
|
|
59809
59816
|
}
|
|
59810
|
-
function getCrossProductIntersections(types) {
|
|
59817
|
+
function getCrossProductIntersections(types, flags) {
|
|
59811
59818
|
const count = getCrossProductUnionSize(types);
|
|
59812
59819
|
const intersections = [];
|
|
59813
59820
|
for (let i = 0; i < count; i++) {
|
|
@@ -59821,7 +59828,7 @@ function createTypeChecker(host) {
|
|
|
59821
59828
|
n = Math.floor(n / length2);
|
|
59822
59829
|
}
|
|
59823
59830
|
}
|
|
59824
|
-
const t = getIntersectionType(constituents);
|
|
59831
|
+
const t = getIntersectionType(constituents, flags);
|
|
59825
59832
|
if (!(t.flags & 131072 /* Never */))
|
|
59826
59833
|
intersections.push(t);
|
|
59827
59834
|
}
|
|
@@ -59841,7 +59848,7 @@ function createTypeChecker(host) {
|
|
|
59841
59848
|
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
59842
59849
|
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
59843
59850
|
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
59844
|
-
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol)
|
|
59851
|
+
links.resolvedType = getIntersectionType(types, noSupertypeReduction ? 1 /* NoSupertypeReduction */ : 0, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
|
|
59845
59852
|
}
|
|
59846
59853
|
return links.resolvedType;
|
|
59847
59854
|
}
|
|
@@ -60532,7 +60539,7 @@ function createTypeChecker(host) {
|
|
|
60532
60539
|
if (wasMissingProp) {
|
|
60533
60540
|
return void 0;
|
|
60534
60541
|
}
|
|
60535
|
-
return accessFlags & 4 /* Writing */ ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
60542
|
+
return accessFlags & 4 /* Writing */ ? getIntersectionType(propTypes, 0 /* None */, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
60536
60543
|
}
|
|
60537
60544
|
return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, accessNode, accessFlags | 8 /* CacheSymbol */ | 64 /* ReportDeprecated */);
|
|
60538
60545
|
}
|
|
@@ -61656,7 +61663,7 @@ function createTypeChecker(host) {
|
|
|
61656
61663
|
}
|
|
61657
61664
|
const newAliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
61658
61665
|
const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);
|
|
61659
|
-
return flags & 2097152 /* Intersection */ || origin && origin.flags & 2097152 /* Intersection */ ? getIntersectionType(newTypes, newAliasSymbol, newAliasTypeArguments) : getUnionType(newTypes, 1 /* Literal */, newAliasSymbol, newAliasTypeArguments);
|
|
61666
|
+
return flags & 2097152 /* Intersection */ || origin && origin.flags & 2097152 /* Intersection */ ? getIntersectionType(newTypes, 0 /* None */, newAliasSymbol, newAliasTypeArguments) : getUnionType(newTypes, 1 /* Literal */, newAliasSymbol, newAliasTypeArguments);
|
|
61660
61667
|
}
|
|
61661
61668
|
if (flags & 4194304 /* Index */) {
|
|
61662
61669
|
return getIndexType(instantiateType(type.type, mapper));
|
|
@@ -71196,8 +71203,13 @@ function createTypeChecker(host) {
|
|
|
71196
71203
|
if (left.typeParameters && right.typeParameters) {
|
|
71197
71204
|
paramMapper = createTypeMapper(right.typeParameters, left.typeParameters);
|
|
71198
71205
|
}
|
|
71206
|
+
let flags = (left.flags | right.flags) & (167 /* PropagatingFlags */ & ~1 /* HasRestParameter */);
|
|
71199
71207
|
const declaration = left.declaration;
|
|
71200
71208
|
const params = combineIntersectionParameters(left, right, paramMapper);
|
|
71209
|
+
const lastParam = lastOrUndefined(params);
|
|
71210
|
+
if (lastParam && getCheckFlags(lastParam) & 32768 /* RestParameter */) {
|
|
71211
|
+
flags |= 1 /* HasRestParameter */;
|
|
71212
|
+
}
|
|
71201
71213
|
const thisParam = combineIntersectionThisParam(left.thisParameter, right.thisParameter, paramMapper);
|
|
71202
71214
|
const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount);
|
|
71203
71215
|
const result = createSignature(
|
|
@@ -71210,7 +71222,7 @@ function createTypeChecker(host) {
|
|
|
71210
71222
|
/*resolvedTypePredicate*/
|
|
71211
71223
|
void 0,
|
|
71212
71224
|
minArgCount,
|
|
71213
|
-
|
|
71225
|
+
flags
|
|
71214
71226
|
);
|
|
71215
71227
|
result.compositeKind = 2097152 /* Intersection */;
|
|
71216
71228
|
result.compositeSignatures = concatenate(left.compositeKind === 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
|
|
@@ -118794,41 +118806,10 @@ function getLibraryNameFromLibFileName(libFileName) {
|
|
|
118794
118806
|
}
|
|
118795
118807
|
return "@typescript/lib-" + path;
|
|
118796
118808
|
}
|
|
118797
|
-
function getLibNameFromLibReference(libReference) {
|
|
118798
|
-
return toFileNameLowerCase(libReference.fileName);
|
|
118799
|
-
}
|
|
118800
118809
|
function getLibFileNameFromLibReference(libReference) {
|
|
118801
|
-
const libName =
|
|
118802
|
-
|
|
118803
|
-
}
|
|
118804
|
-
function fileIncludeReasonIsEqual(a, b) {
|
|
118805
|
-
if (a === b)
|
|
118806
|
-
return true;
|
|
118807
|
-
if (a.kind !== b.kind)
|
|
118808
|
-
return false;
|
|
118809
|
-
switch (a.kind) {
|
|
118810
|
-
case 0 /* RootFile */:
|
|
118811
|
-
Debug.type(b);
|
|
118812
|
-
return a.index === b.index;
|
|
118813
|
-
case 6 /* LibFile */:
|
|
118814
|
-
Debug.type(b);
|
|
118815
|
-
return a.index === b.index;
|
|
118816
|
-
case 1 /* SourceFromProjectReference */:
|
|
118817
|
-
case 2 /* OutputFromProjectReference */:
|
|
118818
|
-
Debug.type(b);
|
|
118819
|
-
return a.index === b.index;
|
|
118820
|
-
case 3 /* Import */:
|
|
118821
|
-
case 4 /* ReferenceFile */:
|
|
118822
|
-
case 5 /* TypeReferenceDirective */:
|
|
118823
|
-
case 7 /* LibReferenceDirective */:
|
|
118824
|
-
Debug.type(b);
|
|
118825
|
-
return a.file === b.file && a.index === b.index;
|
|
118826
|
-
case 8 /* AutomaticTypeDirectiveFile */:
|
|
118827
|
-
Debug.type(b);
|
|
118828
|
-
return a.typeReference === b.typeReference && packageIdIsEqual(a.packageId, b.packageId);
|
|
118829
|
-
default:
|
|
118830
|
-
return Debug.assertNever(a);
|
|
118831
|
-
}
|
|
118810
|
+
const libName = toFileNameLowerCase(libReference.fileName);
|
|
118811
|
+
const libFileName = libMap.get(libName);
|
|
118812
|
+
return { libName, libFileName };
|
|
118832
118813
|
}
|
|
118833
118814
|
function isReferencedFile(reason) {
|
|
118834
118815
|
switch (reason == null ? void 0 : reason.kind) {
|
|
@@ -119071,8 +119052,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119071
119052
|
let classifiableNames;
|
|
119072
119053
|
const ambientModuleNameToUnmodifiedFileName = /* @__PURE__ */ new Map();
|
|
119073
119054
|
let fileReasons = createMultiMap();
|
|
119074
|
-
let fileReasonsToChain;
|
|
119075
|
-
let reasonToRelatedInfo;
|
|
119076
119055
|
const cachedBindAndCheckDiagnosticsForFile = {};
|
|
119077
119056
|
const cachedDeclarationDiagnosticsForFile = {};
|
|
119078
119057
|
let resolvedTypeReferenceDirectives = createModeAwareCache();
|
|
@@ -119104,7 +119083,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119104
119083
|
const getDefaultLibraryFileName = memoize(() => host.getDefaultLibFileName(options));
|
|
119105
119084
|
const defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : getDirectoryPath(getDefaultLibraryFileName());
|
|
119106
119085
|
const programDiagnostics = createDiagnosticCollection();
|
|
119107
|
-
let lazyProgramDiagnosticExplainingFile = [];
|
|
119108
119086
|
const currentDirectory = host.getCurrentDirectory();
|
|
119109
119087
|
const supportedExtensions = getSupportedExtensions(options);
|
|
119110
119088
|
const supportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
|
|
@@ -119433,64 +119411,24 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119433
119411
|
writeFile: writeFile2
|
|
119434
119412
|
};
|
|
119435
119413
|
onProgramCreateComplete();
|
|
119414
|
+
fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
|
|
119415
|
+
switch (diagnostic.kind) {
|
|
119416
|
+
case 1 /* FilePreprocessingFileExplainingDiagnostic */:
|
|
119417
|
+
return programDiagnostics.add(createDiagnosticExplainingFile(diagnostic.file && getSourceFileByPath(diagnostic.file), diagnostic.fileProcessingReason, diagnostic.diagnostic, diagnostic.args || emptyArray));
|
|
119418
|
+
case 0 /* FilePreprocessingReferencedDiagnostic */:
|
|
119419
|
+
const { file, pos, end } = getReferencedFileLocation(program, diagnostic.reason);
|
|
119420
|
+
return programDiagnostics.add(createFileDiagnostic(file, Debug.checkDefined(pos), Debug.checkDefined(end) - pos, diagnostic.diagnostic, ...diagnostic.args || emptyArray));
|
|
119421
|
+
case 2 /* ResolutionDiagnostics */:
|
|
119422
|
+
return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d));
|
|
119423
|
+
default:
|
|
119424
|
+
Debug.assertNever(diagnostic);
|
|
119425
|
+
}
|
|
119426
|
+
});
|
|
119436
119427
|
verifyCompilerOptions();
|
|
119437
119428
|
mark("afterProgram");
|
|
119438
119429
|
measure("Program", "beforeProgram", "afterProgram");
|
|
119439
119430
|
(_p = tracing) == null ? void 0 : _p.pop();
|
|
119440
119431
|
return program;
|
|
119441
|
-
function updateAndGetProgramDiagnostics() {
|
|
119442
|
-
if (lazyProgramDiagnosticExplainingFile) {
|
|
119443
|
-
fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
|
|
119444
|
-
switch (diagnostic.kind) {
|
|
119445
|
-
case 1 /* FilePreprocessingFileExplainingDiagnostic */:
|
|
119446
|
-
return programDiagnostics.add(
|
|
119447
|
-
createDiagnosticExplainingFile(
|
|
119448
|
-
diagnostic.file && getSourceFileByPath(diagnostic.file),
|
|
119449
|
-
diagnostic.fileProcessingReason,
|
|
119450
|
-
diagnostic.diagnostic,
|
|
119451
|
-
diagnostic.args || emptyArray
|
|
119452
|
-
)
|
|
119453
|
-
);
|
|
119454
|
-
case 0 /* FilePreprocessingLibreferenceDiagnostic */:
|
|
119455
|
-
return programDiagnostics.add(filePreprocessingLibreferenceDiagnostic(diagnostic));
|
|
119456
|
-
case 2 /* ResolutionDiagnostics */:
|
|
119457
|
-
return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d));
|
|
119458
|
-
default:
|
|
119459
|
-
Debug.assertNever(diagnostic);
|
|
119460
|
-
}
|
|
119461
|
-
});
|
|
119462
|
-
lazyProgramDiagnosticExplainingFile.forEach(
|
|
119463
|
-
({ file, diagnostic, args }) => programDiagnostics.add(
|
|
119464
|
-
createDiagnosticExplainingFile(
|
|
119465
|
-
file,
|
|
119466
|
-
/*fileProcessingReason*/
|
|
119467
|
-
void 0,
|
|
119468
|
-
diagnostic,
|
|
119469
|
-
args
|
|
119470
|
-
)
|
|
119471
|
-
)
|
|
119472
|
-
);
|
|
119473
|
-
lazyProgramDiagnosticExplainingFile = void 0;
|
|
119474
|
-
fileReasonsToChain = void 0;
|
|
119475
|
-
reasonToRelatedInfo = void 0;
|
|
119476
|
-
}
|
|
119477
|
-
return programDiagnostics;
|
|
119478
|
-
}
|
|
119479
|
-
function filePreprocessingLibreferenceDiagnostic({ reason }) {
|
|
119480
|
-
const { file, pos, end } = getReferencedFileLocation(program, reason);
|
|
119481
|
-
const libReference = file.libReferenceDirectives[reason.index];
|
|
119482
|
-
const libName = getLibNameFromLibReference(libReference);
|
|
119483
|
-
const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts");
|
|
119484
|
-
const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity);
|
|
119485
|
-
return createFileDiagnostic(
|
|
119486
|
-
file,
|
|
119487
|
-
Debug.checkDefined(pos),
|
|
119488
|
-
Debug.checkDefined(end) - pos,
|
|
119489
|
-
suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0,
|
|
119490
|
-
libName,
|
|
119491
|
-
suggestion
|
|
119492
|
-
);
|
|
119493
|
-
}
|
|
119494
119432
|
function getResolvedModule(file, moduleName, mode) {
|
|
119495
119433
|
var _a2;
|
|
119496
119434
|
return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a2.get(moduleName, mode);
|
|
@@ -120183,7 +120121,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120183
120121
|
if (skipTypeChecking(sourceFile, options, program)) {
|
|
120184
120122
|
return emptyArray;
|
|
120185
120123
|
}
|
|
120186
|
-
const programDiagnosticsInFile =
|
|
120124
|
+
const programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);
|
|
120187
120125
|
if (!((_a2 = sourceFile.commentDirectives) == null ? void 0 : _a2.length)) {
|
|
120188
120126
|
return programDiagnosticsInFile;
|
|
120189
120127
|
}
|
|
@@ -120530,16 +120468,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120530
120468
|
}
|
|
120531
120469
|
function getOptionsDiagnostics() {
|
|
120532
120470
|
return sortAndDeduplicateDiagnostics(concatenate(
|
|
120533
|
-
|
|
120471
|
+
programDiagnostics.getGlobalDiagnostics(),
|
|
120534
120472
|
getOptionsDiagnosticsOfConfigFile()
|
|
120535
120473
|
));
|
|
120536
120474
|
}
|
|
120537
120475
|
function getOptionsDiagnosticsOfConfigFile() {
|
|
120538
120476
|
if (!options.configFile)
|
|
120539
120477
|
return emptyArray;
|
|
120540
|
-
let diagnostics =
|
|
120478
|
+
let diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName);
|
|
120541
120479
|
forEachResolvedProjectReference2((resolvedRef) => {
|
|
120542
|
-
diagnostics = concatenate(diagnostics,
|
|
120480
|
+
diagnostics = concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName));
|
|
120543
120481
|
});
|
|
120544
120482
|
return diagnostics;
|
|
120545
120483
|
}
|
|
@@ -120713,7 +120651,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120713
120651
|
}
|
|
120714
120652
|
function getLibFileFromReference(ref) {
|
|
120715
120653
|
var _a2;
|
|
120716
|
-
const libFileName = getLibFileNameFromLibReference(ref);
|
|
120654
|
+
const { libFileName } = getLibFileNameFromLibReference(ref);
|
|
120717
120655
|
const actualFileName = libFileName && ((_a2 = resolvedLibReferences == null ? void 0 : resolvedLibReferences.get(libFileName)) == null ? void 0 : _a2.actual);
|
|
120718
120656
|
return actualFileName !== void 0 ? getSourceFile(actualFileName) : void 0;
|
|
120719
120657
|
}
|
|
@@ -120961,12 +120899,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120961
120899
|
return file;
|
|
120962
120900
|
}
|
|
120963
120901
|
function addFileIncludeReason(file, reason) {
|
|
120964
|
-
if (file)
|
|
120965
|
-
|
|
120966
|
-
if (!some(existing, (r) => fileIncludeReasonIsEqual(r, reason))) {
|
|
120967
|
-
fileReasons.add(file.path, reason);
|
|
120968
|
-
}
|
|
120969
|
-
}
|
|
120902
|
+
if (file)
|
|
120903
|
+
fileReasons.add(file.path, reason);
|
|
120970
120904
|
}
|
|
120971
120905
|
function addFileToFilesByName(file, path, fileName, redirectedPath) {
|
|
120972
120906
|
if (redirectedPath) {
|
|
@@ -121196,7 +121130,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121196
121130
|
}
|
|
121197
121131
|
function processLibReferenceDirectives(file) {
|
|
121198
121132
|
forEach(file.libReferenceDirectives, (libReference, index) => {
|
|
121199
|
-
const libFileName = getLibFileNameFromLibReference(libReference);
|
|
121133
|
+
const { libName, libFileName } = getLibFileNameFromLibReference(libReference);
|
|
121200
121134
|
if (libFileName) {
|
|
121201
121135
|
processRootFile(
|
|
121202
121136
|
pathForLibFile(libFileName),
|
|
@@ -121207,9 +121141,15 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121207
121141
|
{ kind: 7 /* LibReferenceDirective */, file: file.path, index }
|
|
121208
121142
|
);
|
|
121209
121143
|
} else {
|
|
121144
|
+
const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts");
|
|
121145
|
+
const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity);
|
|
121146
|
+
const diagnostic = suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0;
|
|
121147
|
+
const args = suggestion ? [libName, suggestion] : [libName];
|
|
121210
121148
|
(fileProcessingDiagnostics || (fileProcessingDiagnostics = [])).push({
|
|
121211
|
-
kind: 0 /*
|
|
121212
|
-
reason: { kind: 7 /* LibReferenceDirective */, file: file.path, index }
|
|
121149
|
+
kind: 0 /* FilePreprocessingReferencedDiagnostic */,
|
|
121150
|
+
reason: { kind: 7 /* LibReferenceDirective */, file: file.path, index },
|
|
121151
|
+
diagnostic,
|
|
121152
|
+
args
|
|
121213
121153
|
});
|
|
121214
121154
|
}
|
|
121215
121155
|
});
|
|
@@ -121270,7 +121210,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121270
121210
|
if (!sourceFile.isDeclarationFile) {
|
|
121271
121211
|
const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
|
|
121272
121212
|
if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
|
|
121273
|
-
|
|
121213
|
+
addProgramDiagnosticExplainingFile(
|
|
121274
121214
|
sourceFile,
|
|
121275
121215
|
Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files,
|
|
121276
121216
|
[sourceFile.fileName, rootDirectory]
|
|
@@ -121400,7 +121340,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121400
121340
|
const rootPaths = new Set(rootNames.map(toPath3));
|
|
121401
121341
|
for (const file of files) {
|
|
121402
121342
|
if (sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
|
|
121403
|
-
|
|
121343
|
+
addProgramDiagnosticExplainingFile(
|
|
121404
121344
|
file,
|
|
121405
121345
|
Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern,
|
|
121406
121346
|
[file.fileName, options.configFilePath || ""]
|
|
@@ -121763,90 +121703,31 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121763
121703
|
});
|
|
121764
121704
|
}
|
|
121765
121705
|
function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
|
|
121766
|
-
|
|
121767
|
-
const reasons = file && fileReasons.get(file.path);
|
|
121706
|
+
var _a2;
|
|
121768
121707
|
let fileIncludeReasons;
|
|
121769
121708
|
let relatedInfo;
|
|
121770
121709
|
let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0;
|
|
121771
|
-
|
|
121772
|
-
|
|
121773
|
-
let cachedChain = file && (fileReasonsToChain == null ? void 0 : fileReasonsToChain.get(file.path));
|
|
121774
|
-
let chain;
|
|
121775
|
-
if (cachedChain) {
|
|
121776
|
-
if (cachedChain.fileIncludeReasonDetails) {
|
|
121777
|
-
seenReasons = new Set(reasons);
|
|
121778
|
-
reasons == null ? void 0 : reasons.forEach(populateRelatedInfo);
|
|
121779
|
-
} else {
|
|
121780
|
-
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
121781
|
-
}
|
|
121782
|
-
redirectInfo = cachedChain.redirectInfo;
|
|
121783
|
-
} else {
|
|
121784
|
-
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
121785
|
-
redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, getCompilerOptionsForFile(file));
|
|
121786
|
-
}
|
|
121710
|
+
if (file)
|
|
121711
|
+
(_a2 = fileReasons.get(file.path)) == null ? void 0 : _a2.forEach(processReason);
|
|
121787
121712
|
if (fileProcessingReason)
|
|
121788
121713
|
processReason(fileProcessingReason);
|
|
121789
|
-
|
|
121790
|
-
|
|
121791
|
-
seenReasons = void 0;
|
|
121792
|
-
if (seenReasons && cachedChain) {
|
|
121793
|
-
if (cachedChain.details && !processedExtraReason) {
|
|
121794
|
-
chain = chainDiagnosticMessages(cachedChain.details, diagnostic, ...args || emptyArray);
|
|
121795
|
-
} else if (cachedChain.fileIncludeReasonDetails) {
|
|
121796
|
-
if (!processedExtraReason) {
|
|
121797
|
-
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
121798
|
-
fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails;
|
|
121799
|
-
} else {
|
|
121800
|
-
fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length);
|
|
121801
|
-
}
|
|
121802
|
-
} else {
|
|
121803
|
-
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
121804
|
-
fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next, fileIncludeReasons[0]];
|
|
121805
|
-
} else {
|
|
121806
|
-
fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length), fileIncludeReasons[0]);
|
|
121807
|
-
}
|
|
121808
|
-
}
|
|
121809
|
-
}
|
|
121810
|
-
}
|
|
121811
|
-
if (!chain) {
|
|
121812
|
-
if (!fileIncludeReasonDetails)
|
|
121813
|
-
fileIncludeReasonDetails = seenReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
|
|
121814
|
-
chain = chainDiagnosticMessages(
|
|
121815
|
-
redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails,
|
|
121816
|
-
diagnostic,
|
|
121817
|
-
...args || emptyArray
|
|
121818
|
-
);
|
|
121819
|
-
}
|
|
121820
|
-
if (file) {
|
|
121821
|
-
if (cachedChain) {
|
|
121822
|
-
if (!cachedChain.fileIncludeReasonDetails || !processedExtraReason && fileIncludeReasonDetails) {
|
|
121823
|
-
cachedChain.fileIncludeReasonDetails = fileIncludeReasonDetails;
|
|
121824
|
-
}
|
|
121825
|
-
} else {
|
|
121826
|
-
(fileReasonsToChain ?? (fileReasonsToChain = /* @__PURE__ */ new Map())).set(file.path, cachedChain = { fileIncludeReasonDetails, redirectInfo });
|
|
121827
|
-
}
|
|
121828
|
-
if (!cachedChain.details && !processedExtraReason)
|
|
121829
|
-
cachedChain.details = chain.next;
|
|
121830
|
-
}
|
|
121714
|
+
if (locationReason && (fileIncludeReasons == null ? void 0 : fileIncludeReasons.length) === 1)
|
|
121715
|
+
fileIncludeReasons = void 0;
|
|
121831
121716
|
const location = locationReason && getReferencedFileLocation(program, locationReason);
|
|
121717
|
+
const fileIncludeReasonDetails = fileIncludeReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
|
|
121718
|
+
const optionsForFile = file && getCompilerOptionsForFile(file) || options;
|
|
121719
|
+
const redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, optionsForFile);
|
|
121720
|
+
const chain = chainDiagnosticMessages(redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails, diagnostic, ...args || emptyArray);
|
|
121832
121721
|
return location && isReferenceFileLocation(location) ? createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) : createCompilerDiagnosticFromMessageChain(chain, relatedInfo);
|
|
121833
121722
|
function processReason(reason) {
|
|
121834
|
-
|
|
121835
|
-
return;
|
|
121836
|
-
(seenReasons ?? (seenReasons = /* @__PURE__ */ new Set())).add(reason);
|
|
121837
|
-
(fileIncludeReasons ?? (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program, reason));
|
|
121838
|
-
populateRelatedInfo(reason);
|
|
121839
|
-
}
|
|
121840
|
-
function populateRelatedInfo(reason) {
|
|
121723
|
+
(fileIncludeReasons || (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program, reason));
|
|
121841
121724
|
if (!locationReason && isReferencedFile(reason)) {
|
|
121842
121725
|
locationReason = reason;
|
|
121843
121726
|
} else if (locationReason !== reason) {
|
|
121844
|
-
relatedInfo = append(relatedInfo,
|
|
121727
|
+
relatedInfo = append(relatedInfo, fileIncludeReasonToRelatedInformation(reason));
|
|
121845
121728
|
}
|
|
121846
|
-
|
|
121847
|
-
|
|
121848
|
-
var _a2;
|
|
121849
|
-
return ((_a2 = cachedChain.fileIncludeReasonDetails.next) == null ? void 0 : _a2.length) !== (reasons == null ? void 0 : reasons.length);
|
|
121729
|
+
if (reason === fileProcessingReason)
|
|
121730
|
+
fileProcessingReason = void 0;
|
|
121850
121731
|
}
|
|
121851
121732
|
}
|
|
121852
121733
|
function addFilePreprocessingFileExplainingDiagnostic(file, fileProcessingReason, diagnostic, args) {
|
|
@@ -121858,14 +121739,14 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121858
121739
|
args
|
|
121859
121740
|
});
|
|
121860
121741
|
}
|
|
121861
|
-
function
|
|
121862
|
-
|
|
121863
|
-
|
|
121864
|
-
|
|
121865
|
-
|
|
121866
|
-
|
|
121867
|
-
|
|
121868
|
-
|
|
121742
|
+
function addProgramDiagnosticExplainingFile(file, diagnostic, args) {
|
|
121743
|
+
programDiagnostics.add(createDiagnosticExplainingFile(
|
|
121744
|
+
file,
|
|
121745
|
+
/*fileProcessingReason*/
|
|
121746
|
+
void 0,
|
|
121747
|
+
diagnostic,
|
|
121748
|
+
args
|
|
121749
|
+
));
|
|
121869
121750
|
}
|
|
121870
121751
|
function fileIncludeReasonToRelatedInformation(reason) {
|
|
121871
121752
|
if (isReferencedFile(reason)) {
|
package/lib/typescript.js
CHANGED
|
@@ -99,6 +99,7 @@ __export(typescript_exports, {
|
|
|
99
99
|
InlayHints: () => ts_InlayHints_exports,
|
|
100
100
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
101
101
|
InternalSymbolName: () => InternalSymbolName,
|
|
102
|
+
IntersectionFlags: () => IntersectionFlags,
|
|
102
103
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
103
104
|
JSDocParsingMode: () => JSDocParsingMode,
|
|
104
105
|
JsDoc: () => ts_JsDoc_exports,
|
|
@@ -1984,7 +1985,6 @@ __export(typescript_exports, {
|
|
|
1984
1985
|
or: () => or,
|
|
1985
1986
|
orderedRemoveItem: () => orderedRemoveItem,
|
|
1986
1987
|
orderedRemoveItemAt: () => orderedRemoveItemAt,
|
|
1987
|
-
packageIdIsEqual: () => packageIdIsEqual,
|
|
1988
1988
|
packageIdToPackageName: () => packageIdToPackageName,
|
|
1989
1989
|
packageIdToString: () => packageIdToString,
|
|
1990
1990
|
paramHelper: () => paramHelper,
|
|
@@ -2364,7 +2364,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2364
2364
|
|
|
2365
2365
|
// src/compiler/corePublic.ts
|
|
2366
2366
|
var versionMajorMinor = "5.5";
|
|
2367
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2367
|
+
var version = `${versionMajorMinor}.0-insiders.20240505`;
|
|
2368
2368
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2369
2369
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2370
2370
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6355,7 +6355,7 @@ var FileIncludeKind = /* @__PURE__ */ ((FileIncludeKind2) => {
|
|
|
6355
6355
|
return FileIncludeKind2;
|
|
6356
6356
|
})(FileIncludeKind || {});
|
|
6357
6357
|
var FilePreprocessingDiagnosticsKind = /* @__PURE__ */ ((FilePreprocessingDiagnosticsKind2) => {
|
|
6358
|
-
FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["
|
|
6358
|
+
FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["FilePreprocessingReferencedDiagnostic"] = 0] = "FilePreprocessingReferencedDiagnostic";
|
|
6359
6359
|
FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["FilePreprocessingFileExplainingDiagnostic"] = 1] = "FilePreprocessingFileExplainingDiagnostic";
|
|
6360
6360
|
FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["ResolutionDiagnostics"] = 2] = "ResolutionDiagnostics";
|
|
6361
6361
|
return FilePreprocessingDiagnosticsKind2;
|
|
@@ -6391,6 +6391,12 @@ var UnionReduction = /* @__PURE__ */ ((UnionReduction2) => {
|
|
|
6391
6391
|
UnionReduction2[UnionReduction2["Subtype"] = 2] = "Subtype";
|
|
6392
6392
|
return UnionReduction2;
|
|
6393
6393
|
})(UnionReduction || {});
|
|
6394
|
+
var IntersectionFlags = /* @__PURE__ */ ((IntersectionFlags2) => {
|
|
6395
|
+
IntersectionFlags2[IntersectionFlags2["None"] = 0] = "None";
|
|
6396
|
+
IntersectionFlags2[IntersectionFlags2["NoSupertypeReduction"] = 1] = "NoSupertypeReduction";
|
|
6397
|
+
IntersectionFlags2[IntersectionFlags2["NoConstraintReduction"] = 2] = "NoConstraintReduction";
|
|
6398
|
+
return IntersectionFlags2;
|
|
6399
|
+
})(IntersectionFlags || {});
|
|
6394
6400
|
var ContextFlags = /* @__PURE__ */ ((ContextFlags3) => {
|
|
6395
6401
|
ContextFlags3[ContextFlags3["None"] = 0] = "None";
|
|
6396
6402
|
ContextFlags3[ContextFlags3["Signature"] = 1] = "Signature";
|
|
@@ -20451,6 +20457,8 @@ function getAllAccessorDeclarations(declarations, accessor) {
|
|
|
20451
20457
|
function getEffectiveTypeAnnotationNode(node) {
|
|
20452
20458
|
if (!isInJSFile(node) && isFunctionDeclaration(node))
|
|
20453
20459
|
return void 0;
|
|
20460
|
+
if (isTypeAliasDeclaration(node))
|
|
20461
|
+
return void 0;
|
|
20454
20462
|
const type = node.type;
|
|
20455
20463
|
if (type || !isInJSFile(node))
|
|
20456
20464
|
return type;
|
|
@@ -61024,8 +61032,13 @@ function createTypeChecker(host) {
|
|
|
61024
61032
|
if (left.typeParameters && right.typeParameters) {
|
|
61025
61033
|
paramMapper = createTypeMapper(right.typeParameters, left.typeParameters);
|
|
61026
61034
|
}
|
|
61035
|
+
let flags = (left.flags | right.flags) & (167 /* PropagatingFlags */ & ~1 /* HasRestParameter */);
|
|
61027
61036
|
const declaration = left.declaration;
|
|
61028
61037
|
const params = combineUnionParameters(left, right, paramMapper);
|
|
61038
|
+
const lastParam = lastOrUndefined(params);
|
|
61039
|
+
if (lastParam && getCheckFlags(lastParam) & 32768 /* RestParameter */) {
|
|
61040
|
+
flags |= 1 /* HasRestParameter */;
|
|
61041
|
+
}
|
|
61029
61042
|
const thisParam = combineUnionThisParam(left.thisParameter, right.thisParameter, paramMapper);
|
|
61030
61043
|
const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount);
|
|
61031
61044
|
const result = createSignature(
|
|
@@ -61038,7 +61051,7 @@ function createTypeChecker(host) {
|
|
|
61038
61051
|
/*resolvedTypePredicate*/
|
|
61039
61052
|
void 0,
|
|
61040
61053
|
minArgCount,
|
|
61041
|
-
|
|
61054
|
+
flags
|
|
61042
61055
|
);
|
|
61043
61056
|
result.compositeKind = 1048576 /* Union */;
|
|
61044
61057
|
result.compositeSignatures = concatenate(left.compositeKind !== 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
|
|
@@ -61740,7 +61753,7 @@ function createTypeChecker(host) {
|
|
|
61740
61753
|
}
|
|
61741
61754
|
}
|
|
61742
61755
|
return getNormalizedType(
|
|
61743
|
-
getIntersectionType(constraints),
|
|
61756
|
+
getIntersectionType(constraints, 2 /* NoConstraintReduction */),
|
|
61744
61757
|
/*writing*/
|
|
61745
61758
|
false
|
|
61746
61759
|
);
|
|
@@ -64545,7 +64558,7 @@ function createTypeChecker(host) {
|
|
|
64545
64558
|
result.aliasTypeArguments = aliasTypeArguments;
|
|
64546
64559
|
return result;
|
|
64547
64560
|
}
|
|
64548
|
-
function getIntersectionType(types, aliasSymbol, aliasTypeArguments
|
|
64561
|
+
function getIntersectionType(types, flags = 0 /* None */, aliasSymbol, aliasTypeArguments) {
|
|
64549
64562
|
const typeMembershipMap = /* @__PURE__ */ new Map();
|
|
64550
64563
|
const includes = addTypesToIntersection(typeMembershipMap, 0, types);
|
|
64551
64564
|
const typeSet = arrayFrom(typeMembershipMap.values());
|
|
@@ -64566,7 +64579,7 @@ function createTypeChecker(host) {
|
|
|
64566
64579
|
return includes & 16777216 /* IncludesEmptyObject */ ? neverType : includes & 32768 /* Undefined */ ? undefinedType : nullType;
|
|
64567
64580
|
}
|
|
64568
64581
|
if (includes & 4 /* String */ && includes & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) || includes & 8 /* Number */ && includes & 256 /* NumberLiteral */ || includes & 64 /* BigInt */ && includes & 2048 /* BigIntLiteral */ || includes & 4096 /* ESSymbol */ && includes & 8192 /* UniqueESSymbol */ || includes & 16384 /* Void */ && includes & 32768 /* Undefined */ || includes & 16777216 /* IncludesEmptyObject */ && includes & 470302716 /* DefinitelyNonNullable */) {
|
|
64569
|
-
if (!
|
|
64582
|
+
if (!(flags & 1 /* NoSupertypeReduction */))
|
|
64570
64583
|
removeRedundantSupertypes(typeSet, includes);
|
|
64571
64584
|
}
|
|
64572
64585
|
if (includes & 262144 /* IncludesMissingType */) {
|
|
@@ -64578,7 +64591,7 @@ function createTypeChecker(host) {
|
|
|
64578
64591
|
if (typeSet.length === 1) {
|
|
64579
64592
|
return typeSet[0];
|
|
64580
64593
|
}
|
|
64581
|
-
if (typeSet.length === 2) {
|
|
64594
|
+
if (typeSet.length === 2 && !(flags & 2 /* NoConstraintReduction */)) {
|
|
64582
64595
|
const typeVarIndex = typeSet[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
64583
64596
|
const typeVariable = typeSet[typeVarIndex];
|
|
64584
64597
|
const primitiveType = typeSet[1 - typeVarIndex];
|
|
@@ -64597,27 +64610,27 @@ function createTypeChecker(host) {
|
|
|
64597
64610
|
}
|
|
64598
64611
|
}
|
|
64599
64612
|
}
|
|
64600
|
-
const id = getTypeListId(typeSet) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
64613
|
+
const id = getTypeListId(typeSet) + (flags & 2 /* NoConstraintReduction */ ? "*" : getAliasId(aliasSymbol, aliasTypeArguments));
|
|
64601
64614
|
let result = intersectionTypes.get(id);
|
|
64602
64615
|
if (!result) {
|
|
64603
64616
|
if (includes & 1048576 /* Union */) {
|
|
64604
64617
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
64605
|
-
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
64618
|
+
result = getIntersectionType(typeSet, flags, aliasSymbol, aliasTypeArguments);
|
|
64606
64619
|
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) {
|
|
64607
64620
|
const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
|
|
64608
64621
|
removeFromEach(typeSet, 32768 /* Undefined */);
|
|
64609
|
-
result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
64622
|
+
result = getUnionType([getIntersectionType(typeSet, flags), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
64610
64623
|
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
|
|
64611
64624
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
64612
|
-
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
64625
|
+
result = getUnionType([getIntersectionType(typeSet, flags), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
64613
64626
|
} else if (typeSet.length >= 4) {
|
|
64614
64627
|
const middle = Math.floor(typeSet.length / 2);
|
|
64615
|
-
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments);
|
|
64628
|
+
result = getIntersectionType([getIntersectionType(typeSet.slice(0, middle), flags), getIntersectionType(typeSet.slice(middle), flags)], flags, aliasSymbol, aliasTypeArguments);
|
|
64616
64629
|
} else {
|
|
64617
64630
|
if (!checkCrossProductUnion(typeSet)) {
|
|
64618
64631
|
return errorType;
|
|
64619
64632
|
}
|
|
64620
|
-
const constituents = getCrossProductIntersections(typeSet);
|
|
64633
|
+
const constituents = getCrossProductIntersections(typeSet, flags);
|
|
64621
64634
|
const origin = some(constituents, (t) => !!(t.flags & 2097152 /* Intersection */)) && getConstituentCountOfTypes(constituents) > getConstituentCountOfTypes(typeSet) ? createOriginUnionOrIntersectionType(2097152 /* Intersection */, typeSet) : void 0;
|
|
64622
64635
|
result = getUnionType(constituents, 1 /* Literal */, aliasSymbol, aliasTypeArguments, origin);
|
|
64623
64636
|
}
|
|
@@ -64641,7 +64654,7 @@ function createTypeChecker(host) {
|
|
|
64641
64654
|
}
|
|
64642
64655
|
return true;
|
|
64643
64656
|
}
|
|
64644
|
-
function getCrossProductIntersections(types) {
|
|
64657
|
+
function getCrossProductIntersections(types, flags) {
|
|
64645
64658
|
const count = getCrossProductUnionSize(types);
|
|
64646
64659
|
const intersections = [];
|
|
64647
64660
|
for (let i = 0; i < count; i++) {
|
|
@@ -64655,7 +64668,7 @@ function createTypeChecker(host) {
|
|
|
64655
64668
|
n = Math.floor(n / length2);
|
|
64656
64669
|
}
|
|
64657
64670
|
}
|
|
64658
|
-
const t = getIntersectionType(constituents);
|
|
64671
|
+
const t = getIntersectionType(constituents, flags);
|
|
64659
64672
|
if (!(t.flags & 131072 /* Never */))
|
|
64660
64673
|
intersections.push(t);
|
|
64661
64674
|
}
|
|
@@ -64675,7 +64688,7 @@ function createTypeChecker(host) {
|
|
|
64675
64688
|
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
64676
64689
|
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
64677
64690
|
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
64678
|
-
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol)
|
|
64691
|
+
links.resolvedType = getIntersectionType(types, noSupertypeReduction ? 1 /* NoSupertypeReduction */ : 0, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
|
|
64679
64692
|
}
|
|
64680
64693
|
return links.resolvedType;
|
|
64681
64694
|
}
|
|
@@ -65366,7 +65379,7 @@ function createTypeChecker(host) {
|
|
|
65366
65379
|
if (wasMissingProp) {
|
|
65367
65380
|
return void 0;
|
|
65368
65381
|
}
|
|
65369
|
-
return accessFlags & 4 /* Writing */ ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
65382
|
+
return accessFlags & 4 /* Writing */ ? getIntersectionType(propTypes, 0 /* None */, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
65370
65383
|
}
|
|
65371
65384
|
return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, accessNode, accessFlags | 8 /* CacheSymbol */ | 64 /* ReportDeprecated */);
|
|
65372
65385
|
}
|
|
@@ -66490,7 +66503,7 @@ function createTypeChecker(host) {
|
|
|
66490
66503
|
}
|
|
66491
66504
|
const newAliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
66492
66505
|
const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);
|
|
66493
|
-
return flags & 2097152 /* Intersection */ || origin && origin.flags & 2097152 /* Intersection */ ? getIntersectionType(newTypes, newAliasSymbol, newAliasTypeArguments) : getUnionType(newTypes, 1 /* Literal */, newAliasSymbol, newAliasTypeArguments);
|
|
66506
|
+
return flags & 2097152 /* Intersection */ || origin && origin.flags & 2097152 /* Intersection */ ? getIntersectionType(newTypes, 0 /* None */, newAliasSymbol, newAliasTypeArguments) : getUnionType(newTypes, 1 /* Literal */, newAliasSymbol, newAliasTypeArguments);
|
|
66494
66507
|
}
|
|
66495
66508
|
if (flags & 4194304 /* Index */) {
|
|
66496
66509
|
return getIndexType(instantiateType(type.type, mapper));
|
|
@@ -76030,8 +76043,13 @@ function createTypeChecker(host) {
|
|
|
76030
76043
|
if (left.typeParameters && right.typeParameters) {
|
|
76031
76044
|
paramMapper = createTypeMapper(right.typeParameters, left.typeParameters);
|
|
76032
76045
|
}
|
|
76046
|
+
let flags = (left.flags | right.flags) & (167 /* PropagatingFlags */ & ~1 /* HasRestParameter */);
|
|
76033
76047
|
const declaration = left.declaration;
|
|
76034
76048
|
const params = combineIntersectionParameters(left, right, paramMapper);
|
|
76049
|
+
const lastParam = lastOrUndefined(params);
|
|
76050
|
+
if (lastParam && getCheckFlags(lastParam) & 32768 /* RestParameter */) {
|
|
76051
|
+
flags |= 1 /* HasRestParameter */;
|
|
76052
|
+
}
|
|
76035
76053
|
const thisParam = combineIntersectionThisParam(left.thisParameter, right.thisParameter, paramMapper);
|
|
76036
76054
|
const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount);
|
|
76037
76055
|
const result = createSignature(
|
|
@@ -76044,7 +76062,7 @@ function createTypeChecker(host) {
|
|
|
76044
76062
|
/*resolvedTypePredicate*/
|
|
76045
76063
|
void 0,
|
|
76046
76064
|
minArgCount,
|
|
76047
|
-
|
|
76065
|
+
flags
|
|
76048
76066
|
);
|
|
76049
76067
|
result.compositeKind = 2097152 /* Intersection */;
|
|
76050
76068
|
result.compositeSignatures = concatenate(left.compositeKind === 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
|
|
@@ -123868,41 +123886,10 @@ function getLibraryNameFromLibFileName(libFileName) {
|
|
|
123868
123886
|
}
|
|
123869
123887
|
return "@typescript/lib-" + path;
|
|
123870
123888
|
}
|
|
123871
|
-
function getLibNameFromLibReference(libReference) {
|
|
123872
|
-
return toFileNameLowerCase(libReference.fileName);
|
|
123873
|
-
}
|
|
123874
123889
|
function getLibFileNameFromLibReference(libReference) {
|
|
123875
|
-
const libName =
|
|
123876
|
-
|
|
123877
|
-
}
|
|
123878
|
-
function fileIncludeReasonIsEqual(a, b) {
|
|
123879
|
-
if (a === b)
|
|
123880
|
-
return true;
|
|
123881
|
-
if (a.kind !== b.kind)
|
|
123882
|
-
return false;
|
|
123883
|
-
switch (a.kind) {
|
|
123884
|
-
case 0 /* RootFile */:
|
|
123885
|
-
Debug.type(b);
|
|
123886
|
-
return a.index === b.index;
|
|
123887
|
-
case 6 /* LibFile */:
|
|
123888
|
-
Debug.type(b);
|
|
123889
|
-
return a.index === b.index;
|
|
123890
|
-
case 1 /* SourceFromProjectReference */:
|
|
123891
|
-
case 2 /* OutputFromProjectReference */:
|
|
123892
|
-
Debug.type(b);
|
|
123893
|
-
return a.index === b.index;
|
|
123894
|
-
case 3 /* Import */:
|
|
123895
|
-
case 4 /* ReferenceFile */:
|
|
123896
|
-
case 5 /* TypeReferenceDirective */:
|
|
123897
|
-
case 7 /* LibReferenceDirective */:
|
|
123898
|
-
Debug.type(b);
|
|
123899
|
-
return a.file === b.file && a.index === b.index;
|
|
123900
|
-
case 8 /* AutomaticTypeDirectiveFile */:
|
|
123901
|
-
Debug.type(b);
|
|
123902
|
-
return a.typeReference === b.typeReference && packageIdIsEqual(a.packageId, b.packageId);
|
|
123903
|
-
default:
|
|
123904
|
-
return Debug.assertNever(a);
|
|
123905
|
-
}
|
|
123890
|
+
const libName = toFileNameLowerCase(libReference.fileName);
|
|
123891
|
+
const libFileName = libMap.get(libName);
|
|
123892
|
+
return { libName, libFileName };
|
|
123906
123893
|
}
|
|
123907
123894
|
function isReferencedFile(reason) {
|
|
123908
123895
|
switch (reason == null ? void 0 : reason.kind) {
|
|
@@ -124149,8 +124136,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124149
124136
|
let classifiableNames;
|
|
124150
124137
|
const ambientModuleNameToUnmodifiedFileName = /* @__PURE__ */ new Map();
|
|
124151
124138
|
let fileReasons = createMultiMap();
|
|
124152
|
-
let fileReasonsToChain;
|
|
124153
|
-
let reasonToRelatedInfo;
|
|
124154
124139
|
const cachedBindAndCheckDiagnosticsForFile = {};
|
|
124155
124140
|
const cachedDeclarationDiagnosticsForFile = {};
|
|
124156
124141
|
let resolvedTypeReferenceDirectives = createModeAwareCache();
|
|
@@ -124182,7 +124167,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124182
124167
|
const getDefaultLibraryFileName = memoize(() => host.getDefaultLibFileName(options));
|
|
124183
124168
|
const defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : getDirectoryPath(getDefaultLibraryFileName());
|
|
124184
124169
|
const programDiagnostics = createDiagnosticCollection();
|
|
124185
|
-
let lazyProgramDiagnosticExplainingFile = [];
|
|
124186
124170
|
const currentDirectory = host.getCurrentDirectory();
|
|
124187
124171
|
const supportedExtensions = getSupportedExtensions(options);
|
|
124188
124172
|
const supportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
|
|
@@ -124511,64 +124495,24 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124511
124495
|
writeFile: writeFile2
|
|
124512
124496
|
};
|
|
124513
124497
|
onProgramCreateComplete();
|
|
124498
|
+
fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
|
|
124499
|
+
switch (diagnostic.kind) {
|
|
124500
|
+
case 1 /* FilePreprocessingFileExplainingDiagnostic */:
|
|
124501
|
+
return programDiagnostics.add(createDiagnosticExplainingFile(diagnostic.file && getSourceFileByPath(diagnostic.file), diagnostic.fileProcessingReason, diagnostic.diagnostic, diagnostic.args || emptyArray));
|
|
124502
|
+
case 0 /* FilePreprocessingReferencedDiagnostic */:
|
|
124503
|
+
const { file, pos, end } = getReferencedFileLocation(program, diagnostic.reason);
|
|
124504
|
+
return programDiagnostics.add(createFileDiagnostic(file, Debug.checkDefined(pos), Debug.checkDefined(end) - pos, diagnostic.diagnostic, ...diagnostic.args || emptyArray));
|
|
124505
|
+
case 2 /* ResolutionDiagnostics */:
|
|
124506
|
+
return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d));
|
|
124507
|
+
default:
|
|
124508
|
+
Debug.assertNever(diagnostic);
|
|
124509
|
+
}
|
|
124510
|
+
});
|
|
124514
124511
|
verifyCompilerOptions();
|
|
124515
124512
|
mark("afterProgram");
|
|
124516
124513
|
measure("Program", "beforeProgram", "afterProgram");
|
|
124517
124514
|
(_p = tracing) == null ? void 0 : _p.pop();
|
|
124518
124515
|
return program;
|
|
124519
|
-
function updateAndGetProgramDiagnostics() {
|
|
124520
|
-
if (lazyProgramDiagnosticExplainingFile) {
|
|
124521
|
-
fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
|
|
124522
|
-
switch (diagnostic.kind) {
|
|
124523
|
-
case 1 /* FilePreprocessingFileExplainingDiagnostic */:
|
|
124524
|
-
return programDiagnostics.add(
|
|
124525
|
-
createDiagnosticExplainingFile(
|
|
124526
|
-
diagnostic.file && getSourceFileByPath(diagnostic.file),
|
|
124527
|
-
diagnostic.fileProcessingReason,
|
|
124528
|
-
diagnostic.diagnostic,
|
|
124529
|
-
diagnostic.args || emptyArray
|
|
124530
|
-
)
|
|
124531
|
-
);
|
|
124532
|
-
case 0 /* FilePreprocessingLibreferenceDiagnostic */:
|
|
124533
|
-
return programDiagnostics.add(filePreprocessingLibreferenceDiagnostic(diagnostic));
|
|
124534
|
-
case 2 /* ResolutionDiagnostics */:
|
|
124535
|
-
return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d));
|
|
124536
|
-
default:
|
|
124537
|
-
Debug.assertNever(diagnostic);
|
|
124538
|
-
}
|
|
124539
|
-
});
|
|
124540
|
-
lazyProgramDiagnosticExplainingFile.forEach(
|
|
124541
|
-
({ file, diagnostic, args }) => programDiagnostics.add(
|
|
124542
|
-
createDiagnosticExplainingFile(
|
|
124543
|
-
file,
|
|
124544
|
-
/*fileProcessingReason*/
|
|
124545
|
-
void 0,
|
|
124546
|
-
diagnostic,
|
|
124547
|
-
args
|
|
124548
|
-
)
|
|
124549
|
-
)
|
|
124550
|
-
);
|
|
124551
|
-
lazyProgramDiagnosticExplainingFile = void 0;
|
|
124552
|
-
fileReasonsToChain = void 0;
|
|
124553
|
-
reasonToRelatedInfo = void 0;
|
|
124554
|
-
}
|
|
124555
|
-
return programDiagnostics;
|
|
124556
|
-
}
|
|
124557
|
-
function filePreprocessingLibreferenceDiagnostic({ reason }) {
|
|
124558
|
-
const { file, pos, end } = getReferencedFileLocation(program, reason);
|
|
124559
|
-
const libReference = file.libReferenceDirectives[reason.index];
|
|
124560
|
-
const libName = getLibNameFromLibReference(libReference);
|
|
124561
|
-
const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts");
|
|
124562
|
-
const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity);
|
|
124563
|
-
return createFileDiagnostic(
|
|
124564
|
-
file,
|
|
124565
|
-
Debug.checkDefined(pos),
|
|
124566
|
-
Debug.checkDefined(end) - pos,
|
|
124567
|
-
suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0,
|
|
124568
|
-
libName,
|
|
124569
|
-
suggestion
|
|
124570
|
-
);
|
|
124571
|
-
}
|
|
124572
124516
|
function getResolvedModule(file, moduleName, mode) {
|
|
124573
124517
|
var _a2;
|
|
124574
124518
|
return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a2.get(moduleName, mode);
|
|
@@ -125261,7 +125205,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
125261
125205
|
if (skipTypeChecking(sourceFile, options, program)) {
|
|
125262
125206
|
return emptyArray;
|
|
125263
125207
|
}
|
|
125264
|
-
const programDiagnosticsInFile =
|
|
125208
|
+
const programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);
|
|
125265
125209
|
if (!((_a2 = sourceFile.commentDirectives) == null ? void 0 : _a2.length)) {
|
|
125266
125210
|
return programDiagnosticsInFile;
|
|
125267
125211
|
}
|
|
@@ -125608,16 +125552,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
125608
125552
|
}
|
|
125609
125553
|
function getOptionsDiagnostics() {
|
|
125610
125554
|
return sortAndDeduplicateDiagnostics(concatenate(
|
|
125611
|
-
|
|
125555
|
+
programDiagnostics.getGlobalDiagnostics(),
|
|
125612
125556
|
getOptionsDiagnosticsOfConfigFile()
|
|
125613
125557
|
));
|
|
125614
125558
|
}
|
|
125615
125559
|
function getOptionsDiagnosticsOfConfigFile() {
|
|
125616
125560
|
if (!options.configFile)
|
|
125617
125561
|
return emptyArray;
|
|
125618
|
-
let diagnostics =
|
|
125562
|
+
let diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName);
|
|
125619
125563
|
forEachResolvedProjectReference2((resolvedRef) => {
|
|
125620
|
-
diagnostics = concatenate(diagnostics,
|
|
125564
|
+
diagnostics = concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName));
|
|
125621
125565
|
});
|
|
125622
125566
|
return diagnostics;
|
|
125623
125567
|
}
|
|
@@ -125791,7 +125735,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
125791
125735
|
}
|
|
125792
125736
|
function getLibFileFromReference(ref) {
|
|
125793
125737
|
var _a2;
|
|
125794
|
-
const libFileName = getLibFileNameFromLibReference(ref);
|
|
125738
|
+
const { libFileName } = getLibFileNameFromLibReference(ref);
|
|
125795
125739
|
const actualFileName = libFileName && ((_a2 = resolvedLibReferences == null ? void 0 : resolvedLibReferences.get(libFileName)) == null ? void 0 : _a2.actual);
|
|
125796
125740
|
return actualFileName !== void 0 ? getSourceFile(actualFileName) : void 0;
|
|
125797
125741
|
}
|
|
@@ -126039,12 +125983,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126039
125983
|
return file;
|
|
126040
125984
|
}
|
|
126041
125985
|
function addFileIncludeReason(file, reason) {
|
|
126042
|
-
if (file)
|
|
126043
|
-
|
|
126044
|
-
if (!some(existing, (r) => fileIncludeReasonIsEqual(r, reason))) {
|
|
126045
|
-
fileReasons.add(file.path, reason);
|
|
126046
|
-
}
|
|
126047
|
-
}
|
|
125986
|
+
if (file)
|
|
125987
|
+
fileReasons.add(file.path, reason);
|
|
126048
125988
|
}
|
|
126049
125989
|
function addFileToFilesByName(file, path, fileName, redirectedPath) {
|
|
126050
125990
|
if (redirectedPath) {
|
|
@@ -126274,7 +126214,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126274
126214
|
}
|
|
126275
126215
|
function processLibReferenceDirectives(file) {
|
|
126276
126216
|
forEach(file.libReferenceDirectives, (libReference, index) => {
|
|
126277
|
-
const libFileName = getLibFileNameFromLibReference(libReference);
|
|
126217
|
+
const { libName, libFileName } = getLibFileNameFromLibReference(libReference);
|
|
126278
126218
|
if (libFileName) {
|
|
126279
126219
|
processRootFile(
|
|
126280
126220
|
pathForLibFile(libFileName),
|
|
@@ -126285,9 +126225,15 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126285
126225
|
{ kind: 7 /* LibReferenceDirective */, file: file.path, index }
|
|
126286
126226
|
);
|
|
126287
126227
|
} else {
|
|
126228
|
+
const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts");
|
|
126229
|
+
const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity);
|
|
126230
|
+
const diagnostic = suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0;
|
|
126231
|
+
const args = suggestion ? [libName, suggestion] : [libName];
|
|
126288
126232
|
(fileProcessingDiagnostics || (fileProcessingDiagnostics = [])).push({
|
|
126289
|
-
kind: 0 /*
|
|
126290
|
-
reason: { kind: 7 /* LibReferenceDirective */, file: file.path, index }
|
|
126233
|
+
kind: 0 /* FilePreprocessingReferencedDiagnostic */,
|
|
126234
|
+
reason: { kind: 7 /* LibReferenceDirective */, file: file.path, index },
|
|
126235
|
+
diagnostic,
|
|
126236
|
+
args
|
|
126291
126237
|
});
|
|
126292
126238
|
}
|
|
126293
126239
|
});
|
|
@@ -126348,7 +126294,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126348
126294
|
if (!sourceFile.isDeclarationFile) {
|
|
126349
126295
|
const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
|
|
126350
126296
|
if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
|
|
126351
|
-
|
|
126297
|
+
addProgramDiagnosticExplainingFile(
|
|
126352
126298
|
sourceFile,
|
|
126353
126299
|
Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files,
|
|
126354
126300
|
[sourceFile.fileName, rootDirectory]
|
|
@@ -126478,7 +126424,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126478
126424
|
const rootPaths = new Set(rootNames.map(toPath3));
|
|
126479
126425
|
for (const file of files) {
|
|
126480
126426
|
if (sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
|
|
126481
|
-
|
|
126427
|
+
addProgramDiagnosticExplainingFile(
|
|
126482
126428
|
file,
|
|
126483
126429
|
Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern,
|
|
126484
126430
|
[file.fileName, options.configFilePath || ""]
|
|
@@ -126841,90 +126787,31 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126841
126787
|
});
|
|
126842
126788
|
}
|
|
126843
126789
|
function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
|
|
126844
|
-
|
|
126845
|
-
const reasons = file && fileReasons.get(file.path);
|
|
126790
|
+
var _a2;
|
|
126846
126791
|
let fileIncludeReasons;
|
|
126847
126792
|
let relatedInfo;
|
|
126848
126793
|
let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0;
|
|
126849
|
-
|
|
126850
|
-
|
|
126851
|
-
let cachedChain = file && (fileReasonsToChain == null ? void 0 : fileReasonsToChain.get(file.path));
|
|
126852
|
-
let chain;
|
|
126853
|
-
if (cachedChain) {
|
|
126854
|
-
if (cachedChain.fileIncludeReasonDetails) {
|
|
126855
|
-
seenReasons = new Set(reasons);
|
|
126856
|
-
reasons == null ? void 0 : reasons.forEach(populateRelatedInfo);
|
|
126857
|
-
} else {
|
|
126858
|
-
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
126859
|
-
}
|
|
126860
|
-
redirectInfo = cachedChain.redirectInfo;
|
|
126861
|
-
} else {
|
|
126862
|
-
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
126863
|
-
redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, getCompilerOptionsForFile(file));
|
|
126864
|
-
}
|
|
126794
|
+
if (file)
|
|
126795
|
+
(_a2 = fileReasons.get(file.path)) == null ? void 0 : _a2.forEach(processReason);
|
|
126865
126796
|
if (fileProcessingReason)
|
|
126866
126797
|
processReason(fileProcessingReason);
|
|
126867
|
-
|
|
126868
|
-
|
|
126869
|
-
seenReasons = void 0;
|
|
126870
|
-
if (seenReasons && cachedChain) {
|
|
126871
|
-
if (cachedChain.details && !processedExtraReason) {
|
|
126872
|
-
chain = chainDiagnosticMessages(cachedChain.details, diagnostic, ...args || emptyArray);
|
|
126873
|
-
} else if (cachedChain.fileIncludeReasonDetails) {
|
|
126874
|
-
if (!processedExtraReason) {
|
|
126875
|
-
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
126876
|
-
fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails;
|
|
126877
|
-
} else {
|
|
126878
|
-
fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length);
|
|
126879
|
-
}
|
|
126880
|
-
} else {
|
|
126881
|
-
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
126882
|
-
fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next, fileIncludeReasons[0]];
|
|
126883
|
-
} else {
|
|
126884
|
-
fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length), fileIncludeReasons[0]);
|
|
126885
|
-
}
|
|
126886
|
-
}
|
|
126887
|
-
}
|
|
126888
|
-
}
|
|
126889
|
-
if (!chain) {
|
|
126890
|
-
if (!fileIncludeReasonDetails)
|
|
126891
|
-
fileIncludeReasonDetails = seenReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
|
|
126892
|
-
chain = chainDiagnosticMessages(
|
|
126893
|
-
redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails,
|
|
126894
|
-
diagnostic,
|
|
126895
|
-
...args || emptyArray
|
|
126896
|
-
);
|
|
126897
|
-
}
|
|
126898
|
-
if (file) {
|
|
126899
|
-
if (cachedChain) {
|
|
126900
|
-
if (!cachedChain.fileIncludeReasonDetails || !processedExtraReason && fileIncludeReasonDetails) {
|
|
126901
|
-
cachedChain.fileIncludeReasonDetails = fileIncludeReasonDetails;
|
|
126902
|
-
}
|
|
126903
|
-
} else {
|
|
126904
|
-
(fileReasonsToChain ?? (fileReasonsToChain = /* @__PURE__ */ new Map())).set(file.path, cachedChain = { fileIncludeReasonDetails, redirectInfo });
|
|
126905
|
-
}
|
|
126906
|
-
if (!cachedChain.details && !processedExtraReason)
|
|
126907
|
-
cachedChain.details = chain.next;
|
|
126908
|
-
}
|
|
126798
|
+
if (locationReason && (fileIncludeReasons == null ? void 0 : fileIncludeReasons.length) === 1)
|
|
126799
|
+
fileIncludeReasons = void 0;
|
|
126909
126800
|
const location = locationReason && getReferencedFileLocation(program, locationReason);
|
|
126801
|
+
const fileIncludeReasonDetails = fileIncludeReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
|
|
126802
|
+
const optionsForFile = file && getCompilerOptionsForFile(file) || options;
|
|
126803
|
+
const redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, optionsForFile);
|
|
126804
|
+
const chain = chainDiagnosticMessages(redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails, diagnostic, ...args || emptyArray);
|
|
126910
126805
|
return location && isReferenceFileLocation(location) ? createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) : createCompilerDiagnosticFromMessageChain(chain, relatedInfo);
|
|
126911
126806
|
function processReason(reason) {
|
|
126912
|
-
|
|
126913
|
-
return;
|
|
126914
|
-
(seenReasons ?? (seenReasons = /* @__PURE__ */ new Set())).add(reason);
|
|
126915
|
-
(fileIncludeReasons ?? (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program, reason));
|
|
126916
|
-
populateRelatedInfo(reason);
|
|
126917
|
-
}
|
|
126918
|
-
function populateRelatedInfo(reason) {
|
|
126807
|
+
(fileIncludeReasons || (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program, reason));
|
|
126919
126808
|
if (!locationReason && isReferencedFile(reason)) {
|
|
126920
126809
|
locationReason = reason;
|
|
126921
126810
|
} else if (locationReason !== reason) {
|
|
126922
|
-
relatedInfo = append(relatedInfo,
|
|
126811
|
+
relatedInfo = append(relatedInfo, fileIncludeReasonToRelatedInformation(reason));
|
|
126923
126812
|
}
|
|
126924
|
-
|
|
126925
|
-
|
|
126926
|
-
var _a2;
|
|
126927
|
-
return ((_a2 = cachedChain.fileIncludeReasonDetails.next) == null ? void 0 : _a2.length) !== (reasons == null ? void 0 : reasons.length);
|
|
126813
|
+
if (reason === fileProcessingReason)
|
|
126814
|
+
fileProcessingReason = void 0;
|
|
126928
126815
|
}
|
|
126929
126816
|
}
|
|
126930
126817
|
function addFilePreprocessingFileExplainingDiagnostic(file, fileProcessingReason, diagnostic, args) {
|
|
@@ -126936,14 +126823,14 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126936
126823
|
args
|
|
126937
126824
|
});
|
|
126938
126825
|
}
|
|
126939
|
-
function
|
|
126940
|
-
|
|
126941
|
-
|
|
126942
|
-
|
|
126943
|
-
|
|
126944
|
-
|
|
126945
|
-
|
|
126946
|
-
|
|
126826
|
+
function addProgramDiagnosticExplainingFile(file, diagnostic, args) {
|
|
126827
|
+
programDiagnostics.add(createDiagnosticExplainingFile(
|
|
126828
|
+
file,
|
|
126829
|
+
/*fileProcessingReason*/
|
|
126830
|
+
void 0,
|
|
126831
|
+
diagnostic,
|
|
126832
|
+
args
|
|
126833
|
+
));
|
|
126947
126834
|
}
|
|
126948
126835
|
function fileIncludeReasonToRelatedInformation(reason) {
|
|
126949
126836
|
if (isReferencedFile(reason)) {
|
|
@@ -179021,6 +178908,7 @@ __export(ts_exports2, {
|
|
|
179021
178908
|
InlayHints: () => ts_InlayHints_exports,
|
|
179022
178909
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
179023
178910
|
InternalSymbolName: () => InternalSymbolName,
|
|
178911
|
+
IntersectionFlags: () => IntersectionFlags,
|
|
179024
178912
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
179025
178913
|
JSDocParsingMode: () => JSDocParsingMode,
|
|
179026
178914
|
JsDoc: () => ts_JsDoc_exports,
|
|
@@ -180906,7 +180794,6 @@ __export(ts_exports2, {
|
|
|
180906
180794
|
or: () => or,
|
|
180907
180795
|
orderedRemoveItem: () => orderedRemoveItem,
|
|
180908
180796
|
orderedRemoveItemAt: () => orderedRemoveItemAt,
|
|
180909
|
-
packageIdIsEqual: () => packageIdIsEqual,
|
|
180910
180797
|
packageIdToPackageName: () => packageIdToPackageName,
|
|
180911
180798
|
packageIdToString: () => packageIdToString,
|
|
180912
180799
|
paramHelper: () => paramHelper,
|
|
@@ -193451,6 +193338,7 @@ if (typeof console !== "undefined") {
|
|
|
193451
193338
|
InlayHints,
|
|
193452
193339
|
InternalEmitFlags,
|
|
193453
193340
|
InternalSymbolName,
|
|
193341
|
+
IntersectionFlags,
|
|
193454
193342
|
InvalidatedProjectKind,
|
|
193455
193343
|
JSDocParsingMode,
|
|
193456
193344
|
JsDoc,
|
|
@@ -195336,7 +195224,6 @@ if (typeof console !== "undefined") {
|
|
|
195336
195224
|
or,
|
|
195337
195225
|
orderedRemoveItem,
|
|
195338
195226
|
orderedRemoveItemAt,
|
|
195339
|
-
packageIdIsEqual,
|
|
195340
195227
|
packageIdToPackageName,
|
|
195341
195228
|
packageIdToString,
|
|
195342
195229
|
paramHelper,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.5.0-pr-
|
|
5
|
+
"version": "5.5.0-pr-58440-3",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|