@typescript-deploys/pr-build 5.4.0-pr-56429-7 → 5.4.0-pr-56434-11
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/lib.esnext.disposable.d.ts +1 -1
- package/lib/tsc.js +28 -29
- package/lib/tsserver.js +35 -29
- package/lib/typescript.js +35 -29
- package/lib/typingsInstaller.js +2 -2
- package/package.json +2 -2
|
@@ -43,7 +43,7 @@ interface SuppressedError extends Error {
|
|
|
43
43
|
suppressed: any;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
interface SuppressedErrorConstructor
|
|
46
|
+
interface SuppressedErrorConstructor {
|
|
47
47
|
new (error: any, suppressed: any, message?: string): SuppressedError;
|
|
48
48
|
(error: any, suppressed: any, message?: string): SuppressedError;
|
|
49
49
|
readonly prototype: SuppressedError;
|
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.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20231117`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3678,7 +3678,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3678
3678
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
3679
3679
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
3680
3680
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
3681
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
3681
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
3682
3682
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
3683
3683
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
3684
3684
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -15987,7 +15987,7 @@ function getClassLikeDeclarationOfSymbol(symbol) {
|
|
|
15987
15987
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
15988
15988
|
}
|
|
15989
15989
|
function getObjectFlags(type) {
|
|
15990
|
-
return type.flags &
|
|
15990
|
+
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
15991
15991
|
}
|
|
15992
15992
|
function isUMDExportSymbol(symbol) {
|
|
15993
15993
|
return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]);
|
|
@@ -48588,7 +48588,7 @@ function createTypeChecker(host) {
|
|
|
48588
48588
|
context.approximateLength += symbolName(propertySymbol).length + 1;
|
|
48589
48589
|
if (propertySymbol.flags & 98304 /* Accessor */) {
|
|
48590
48590
|
const writeType = getWriteTypeOfSymbol(propertySymbol);
|
|
48591
|
-
if (propertyType !== writeType) {
|
|
48591
|
+
if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
|
|
48592
48592
|
const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
|
|
48593
48593
|
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
|
|
48594
48594
|
typeElements.push(
|
|
@@ -52610,7 +52610,7 @@ function createTypeChecker(host) {
|
|
|
52610
52610
|
} else if (getter && noImplicitAny) {
|
|
52611
52611
|
error(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));
|
|
52612
52612
|
}
|
|
52613
|
-
type =
|
|
52613
|
+
type = anyType;
|
|
52614
52614
|
}
|
|
52615
52615
|
links.type = type;
|
|
52616
52616
|
}
|
|
@@ -52628,7 +52628,7 @@ function createTypeChecker(host) {
|
|
|
52628
52628
|
if (getAnnotatedAccessorTypeNode(setter)) {
|
|
52629
52629
|
error(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
52630
52630
|
}
|
|
52631
|
-
writeType =
|
|
52631
|
+
writeType = anyType;
|
|
52632
52632
|
}
|
|
52633
52633
|
links.writeType = writeType || getTypeOfAccessors(symbol);
|
|
52634
52634
|
}
|
|
@@ -52709,7 +52709,8 @@ function createTypeChecker(host) {
|
|
|
52709
52709
|
const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0);
|
|
52710
52710
|
links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
|
|
52711
52711
|
if (!popTypeResolution()) {
|
|
52712
|
-
|
|
52712
|
+
reportCircularityError(exportSymbol ?? symbol);
|
|
52713
|
+
return links.type = errorType;
|
|
52713
52714
|
}
|
|
52714
52715
|
}
|
|
52715
52716
|
return links.type;
|
|
@@ -52738,7 +52739,7 @@ function createTypeChecker(host) {
|
|
|
52738
52739
|
error(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol));
|
|
52739
52740
|
}
|
|
52740
52741
|
}
|
|
52741
|
-
return
|
|
52742
|
+
return anyType;
|
|
52742
52743
|
}
|
|
52743
52744
|
function getTypeOfSymbolWithDeferredType(symbol) {
|
|
52744
52745
|
const links = getSymbolLinks(symbol);
|
|
@@ -55499,7 +55500,7 @@ function createTypeChecker(host) {
|
|
|
55499
55500
|
}
|
|
55500
55501
|
}
|
|
55501
55502
|
}
|
|
55502
|
-
type =
|
|
55503
|
+
type = anyType;
|
|
55503
55504
|
}
|
|
55504
55505
|
signature.resolvedReturnType = type;
|
|
55505
55506
|
}
|
|
@@ -56999,7 +57000,7 @@ function createTypeChecker(host) {
|
|
|
56999
57000
|
}
|
|
57000
57001
|
}
|
|
57001
57002
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
57002
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)
|
|
57003
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
57003
57004
|
if (templates.length) {
|
|
57004
57005
|
let i = types.length;
|
|
57005
57006
|
while (i > 0) {
|
|
@@ -57399,19 +57400,14 @@ function createTypeChecker(host) {
|
|
|
57399
57400
|
function getConstituentCountOfTypes(types) {
|
|
57400
57401
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
57401
57402
|
}
|
|
57402
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
57403
|
-
if (types.length !== 2) {
|
|
57404
|
-
return false;
|
|
57405
|
-
}
|
|
57406
|
-
const [t1, t2] = types;
|
|
57407
|
-
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
57408
|
-
}
|
|
57409
57403
|
function getTypeFromIntersectionTypeNode(node) {
|
|
57410
57404
|
const links = getNodeLinks(node);
|
|
57411
57405
|
if (!links.resolvedType) {
|
|
57412
57406
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
57413
57407
|
const types = map(node.types, getTypeFromTypeNode);
|
|
57414
|
-
const
|
|
57408
|
+
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
57409
|
+
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
57410
|
+
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
57415
57411
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
57416
57412
|
}
|
|
57417
57413
|
return links.resolvedType;
|
|
@@ -57623,11 +57619,6 @@ function createTypeChecker(host) {
|
|
|
57623
57619
|
}
|
|
57624
57620
|
function createTemplateLiteralType(texts, types) {
|
|
57625
57621
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
57626
|
-
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
57627
|
-
types,
|
|
57628
|
-
/*excludeKinds*/
|
|
57629
|
-
98304 /* Nullable */
|
|
57630
|
-
);
|
|
57631
57622
|
type.texts = texts;
|
|
57632
57623
|
type.types = types;
|
|
57633
57624
|
return type;
|
|
@@ -57922,7 +57913,15 @@ function createTypeChecker(host) {
|
|
|
57922
57913
|
}
|
|
57923
57914
|
function isPatternLiteralPlaceholderType(type) {
|
|
57924
57915
|
if (type.flags & 2097152 /* Intersection */) {
|
|
57925
|
-
|
|
57916
|
+
let seenPlaceholder = false;
|
|
57917
|
+
for (const t of type.types) {
|
|
57918
|
+
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
|
|
57919
|
+
seenPlaceholder = true;
|
|
57920
|
+
} else if (!(t.flags & 524288 /* Object */)) {
|
|
57921
|
+
return false;
|
|
57922
|
+
}
|
|
57923
|
+
}
|
|
57924
|
+
return seenPlaceholder;
|
|
57926
57925
|
}
|
|
57927
57926
|
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
57928
57927
|
}
|
|
@@ -57939,7 +57938,7 @@ function createTypeChecker(host) {
|
|
|
57939
57938
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
57940
57939
|
}
|
|
57941
57940
|
function getGenericObjectFlags(type) {
|
|
57942
|
-
if (type.flags &
|
|
57941
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
57943
57942
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
57944
57943
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
57945
57944
|
}
|
|
@@ -57951,7 +57950,7 @@ function createTypeChecker(host) {
|
|
|
57951
57950
|
}
|
|
57952
57951
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
57953
57952
|
}
|
|
57954
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
57953
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
57955
57954
|
}
|
|
57956
57955
|
function getSimplifiedType(type, writing) {
|
|
57957
57956
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -58977,7 +58976,7 @@ function createTypeChecker(host) {
|
|
|
58977
58976
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
58978
58977
|
target.instantiations.set(id, result);
|
|
58979
58978
|
const resultObjectFlags = getObjectFlags(result);
|
|
58980
|
-
if (result.flags &
|
|
58979
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58981
58980
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
58982
58981
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58983
58982
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -63693,8 +63692,8 @@ function createTypeChecker(host) {
|
|
|
63693
63692
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
63694
63693
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
63695
63694
|
}
|
|
63696
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags &
|
|
63697
|
-
if (type.flags &
|
|
63695
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
63696
|
+
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
63698
63697
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
63699
63698
|
}
|
|
63700
63699
|
return result;
|
package/lib/tsserver.js
CHANGED
|
@@ -2330,7 +2330,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2330
2330
|
|
|
2331
2331
|
// src/compiler/corePublic.ts
|
|
2332
2332
|
var versionMajorMinor = "5.4";
|
|
2333
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2333
|
+
var version = `${versionMajorMinor}.0-insiders.20231117`;
|
|
2334
2334
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2335
2335
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2336
2336
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6674,7 +6674,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
6674
6674
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
6675
6675
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
6676
6676
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
6677
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
6677
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
6678
6678
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
6679
6679
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
6680
6680
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -20056,7 +20056,7 @@ function getClassLikeDeclarationOfSymbol(symbol) {
|
|
|
20056
20056
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
20057
20057
|
}
|
|
20058
20058
|
function getObjectFlags(type) {
|
|
20059
|
-
return type.flags &
|
|
20059
|
+
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
20060
20060
|
}
|
|
20061
20061
|
function forSomeAncestorDirectory(directory, callback) {
|
|
20062
20062
|
return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0);
|
|
@@ -53296,7 +53296,7 @@ function createTypeChecker(host) {
|
|
|
53296
53296
|
context.approximateLength += symbolName(propertySymbol).length + 1;
|
|
53297
53297
|
if (propertySymbol.flags & 98304 /* Accessor */) {
|
|
53298
53298
|
const writeType = getWriteTypeOfSymbol(propertySymbol);
|
|
53299
|
-
if (propertyType !== writeType) {
|
|
53299
|
+
if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
|
|
53300
53300
|
const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
|
|
53301
53301
|
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
|
|
53302
53302
|
typeElements.push(
|
|
@@ -57318,7 +57318,7 @@ function createTypeChecker(host) {
|
|
|
57318
57318
|
} else if (getter && noImplicitAny) {
|
|
57319
57319
|
error2(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));
|
|
57320
57320
|
}
|
|
57321
|
-
type =
|
|
57321
|
+
type = anyType;
|
|
57322
57322
|
}
|
|
57323
57323
|
links.type = type;
|
|
57324
57324
|
}
|
|
@@ -57336,7 +57336,7 @@ function createTypeChecker(host) {
|
|
|
57336
57336
|
if (getAnnotatedAccessorTypeNode(setter)) {
|
|
57337
57337
|
error2(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
57338
57338
|
}
|
|
57339
|
-
writeType =
|
|
57339
|
+
writeType = anyType;
|
|
57340
57340
|
}
|
|
57341
57341
|
links.writeType = writeType || getTypeOfAccessors(symbol);
|
|
57342
57342
|
}
|
|
@@ -57417,7 +57417,8 @@ function createTypeChecker(host) {
|
|
|
57417
57417
|
const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0);
|
|
57418
57418
|
links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
|
|
57419
57419
|
if (!popTypeResolution()) {
|
|
57420
|
-
|
|
57420
|
+
reportCircularityError(exportSymbol ?? symbol);
|
|
57421
|
+
return links.type = errorType;
|
|
57421
57422
|
}
|
|
57422
57423
|
}
|
|
57423
57424
|
return links.type;
|
|
@@ -57446,7 +57447,7 @@ function createTypeChecker(host) {
|
|
|
57446
57447
|
error2(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol));
|
|
57447
57448
|
}
|
|
57448
57449
|
}
|
|
57449
|
-
return
|
|
57450
|
+
return anyType;
|
|
57450
57451
|
}
|
|
57451
57452
|
function getTypeOfSymbolWithDeferredType(symbol) {
|
|
57452
57453
|
const links = getSymbolLinks(symbol);
|
|
@@ -60207,7 +60208,7 @@ function createTypeChecker(host) {
|
|
|
60207
60208
|
}
|
|
60208
60209
|
}
|
|
60209
60210
|
}
|
|
60210
|
-
type =
|
|
60211
|
+
type = anyType;
|
|
60211
60212
|
}
|
|
60212
60213
|
signature.resolvedReturnType = type;
|
|
60213
60214
|
}
|
|
@@ -61707,7 +61708,7 @@ function createTypeChecker(host) {
|
|
|
61707
61708
|
}
|
|
61708
61709
|
}
|
|
61709
61710
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
61710
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)
|
|
61711
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
61711
61712
|
if (templates.length) {
|
|
61712
61713
|
let i = types.length;
|
|
61713
61714
|
while (i > 0) {
|
|
@@ -62107,19 +62108,14 @@ function createTypeChecker(host) {
|
|
|
62107
62108
|
function getConstituentCountOfTypes(types) {
|
|
62108
62109
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
62109
62110
|
}
|
|
62110
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
62111
|
-
if (types.length !== 2) {
|
|
62112
|
-
return false;
|
|
62113
|
-
}
|
|
62114
|
-
const [t1, t2] = types;
|
|
62115
|
-
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
62116
|
-
}
|
|
62117
62111
|
function getTypeFromIntersectionTypeNode(node) {
|
|
62118
62112
|
const links = getNodeLinks(node);
|
|
62119
62113
|
if (!links.resolvedType) {
|
|
62120
62114
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
62121
62115
|
const types = map(node.types, getTypeFromTypeNode);
|
|
62122
|
-
const
|
|
62116
|
+
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
62117
|
+
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
62118
|
+
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
62123
62119
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
62124
62120
|
}
|
|
62125
62121
|
return links.resolvedType;
|
|
@@ -62331,11 +62327,6 @@ function createTypeChecker(host) {
|
|
|
62331
62327
|
}
|
|
62332
62328
|
function createTemplateLiteralType(texts, types) {
|
|
62333
62329
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
62334
|
-
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
62335
|
-
types,
|
|
62336
|
-
/*excludeKinds*/
|
|
62337
|
-
98304 /* Nullable */
|
|
62338
|
-
);
|
|
62339
62330
|
type.texts = texts;
|
|
62340
62331
|
type.types = types;
|
|
62341
62332
|
return type;
|
|
@@ -62630,7 +62621,15 @@ function createTypeChecker(host) {
|
|
|
62630
62621
|
}
|
|
62631
62622
|
function isPatternLiteralPlaceholderType(type) {
|
|
62632
62623
|
if (type.flags & 2097152 /* Intersection */) {
|
|
62633
|
-
|
|
62624
|
+
let seenPlaceholder = false;
|
|
62625
|
+
for (const t of type.types) {
|
|
62626
|
+
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
|
|
62627
|
+
seenPlaceholder = true;
|
|
62628
|
+
} else if (!(t.flags & 524288 /* Object */)) {
|
|
62629
|
+
return false;
|
|
62630
|
+
}
|
|
62631
|
+
}
|
|
62632
|
+
return seenPlaceholder;
|
|
62634
62633
|
}
|
|
62635
62634
|
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
62636
62635
|
}
|
|
@@ -62647,7 +62646,7 @@ function createTypeChecker(host) {
|
|
|
62647
62646
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
62648
62647
|
}
|
|
62649
62648
|
function getGenericObjectFlags(type) {
|
|
62650
|
-
if (type.flags &
|
|
62649
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
62651
62650
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
62652
62651
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
62653
62652
|
}
|
|
@@ -62659,7 +62658,7 @@ function createTypeChecker(host) {
|
|
|
62659
62658
|
}
|
|
62660
62659
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
62661
62660
|
}
|
|
62662
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
62661
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
62663
62662
|
}
|
|
62664
62663
|
function getSimplifiedType(type, writing) {
|
|
62665
62664
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -63685,7 +63684,7 @@ function createTypeChecker(host) {
|
|
|
63685
63684
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
63686
63685
|
target.instantiations.set(id, result);
|
|
63687
63686
|
const resultObjectFlags = getObjectFlags(result);
|
|
63688
|
-
if (result.flags &
|
|
63687
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
63689
63688
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
63690
63689
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
63691
63690
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -68401,8 +68400,8 @@ function createTypeChecker(host) {
|
|
|
68401
68400
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
68402
68401
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
68403
68402
|
}
|
|
68404
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags &
|
|
68405
|
-
if (type.flags &
|
|
68403
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
68404
|
+
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
68406
68405
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
68407
68406
|
}
|
|
68408
68407
|
return result;
|
|
@@ -158923,6 +158922,9 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con
|
|
|
158923
158922
|
if (!info || uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === 1 /* Global */ && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) {
|
|
158924
158923
|
continue;
|
|
158925
158924
|
}
|
|
158925
|
+
if (!isTypeOnlyLocation && isInJSFile(sourceFile) && symbolAppearsToBeTypeOnly(symbol)) {
|
|
158926
|
+
continue;
|
|
158927
|
+
}
|
|
158926
158928
|
const { name, needsConvertPropertyAccess } = info;
|
|
158927
158929
|
const originalSortText = (symbolToSortTextMap == null ? void 0 : symbolToSortTextMap[getSymbolId(symbol)]) ?? SortText.LocationPriority;
|
|
158928
158930
|
const sortText = isDeprecated(symbol, typeChecker) ? SortText.Deprecated(originalSortText) : originalSortText;
|
|
@@ -159002,6 +159004,10 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con
|
|
|
159002
159004
|
}
|
|
159003
159005
|
return !!(allFlags & 111551 /* Value */);
|
|
159004
159006
|
}
|
|
159007
|
+
function symbolAppearsToBeTypeOnly(symbol) {
|
|
159008
|
+
var _a;
|
|
159009
|
+
return !(symbol.flags & 111551 /* Value */) && (!isInJSFile((_a = symbol.declarations) == null ? void 0 : _a[0]) || !!(symbol.flags & 788968 /* Type */));
|
|
159010
|
+
}
|
|
159005
159011
|
}
|
|
159006
159012
|
function getLabelCompletionAtPosition(node) {
|
|
159007
159013
|
const entries = getLabelStatementCompletions(node);
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20231117`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4437,7 +4437,7 @@ ${lanes.join("\n")}
|
|
|
4437
4437
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
4438
4438
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
4439
4439
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
4440
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
4440
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
4441
4441
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
4442
4442
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
4443
4443
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -17355,7 +17355,7 @@ ${lanes.join("\n")}
|
|
|
17355
17355
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
17356
17356
|
}
|
|
17357
17357
|
function getObjectFlags(type) {
|
|
17358
|
-
return type.flags &
|
|
17358
|
+
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
17359
17359
|
}
|
|
17360
17360
|
function forSomeAncestorDirectory(directory, callback) {
|
|
17361
17361
|
return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0);
|
|
@@ -51061,7 +51061,7 @@ ${lanes.join("\n")}
|
|
|
51061
51061
|
context.approximateLength += symbolName(propertySymbol).length + 1;
|
|
51062
51062
|
if (propertySymbol.flags & 98304 /* Accessor */) {
|
|
51063
51063
|
const writeType = getWriteTypeOfSymbol(propertySymbol);
|
|
51064
|
-
if (propertyType !== writeType) {
|
|
51064
|
+
if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
|
|
51065
51065
|
const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
|
|
51066
51066
|
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
|
|
51067
51067
|
typeElements.push(
|
|
@@ -55083,7 +55083,7 @@ ${lanes.join("\n")}
|
|
|
55083
55083
|
} else if (getter && noImplicitAny) {
|
|
55084
55084
|
error2(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));
|
|
55085
55085
|
}
|
|
55086
|
-
type =
|
|
55086
|
+
type = anyType;
|
|
55087
55087
|
}
|
|
55088
55088
|
links.type = type;
|
|
55089
55089
|
}
|
|
@@ -55101,7 +55101,7 @@ ${lanes.join("\n")}
|
|
|
55101
55101
|
if (getAnnotatedAccessorTypeNode(setter)) {
|
|
55102
55102
|
error2(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
55103
55103
|
}
|
|
55104
|
-
writeType =
|
|
55104
|
+
writeType = anyType;
|
|
55105
55105
|
}
|
|
55106
55106
|
links.writeType = writeType || getTypeOfAccessors(symbol);
|
|
55107
55107
|
}
|
|
@@ -55182,7 +55182,8 @@ ${lanes.join("\n")}
|
|
|
55182
55182
|
const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0);
|
|
55183
55183
|
links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
|
|
55184
55184
|
if (!popTypeResolution()) {
|
|
55185
|
-
|
|
55185
|
+
reportCircularityError(exportSymbol ?? symbol);
|
|
55186
|
+
return links.type = errorType;
|
|
55186
55187
|
}
|
|
55187
55188
|
}
|
|
55188
55189
|
return links.type;
|
|
@@ -55211,7 +55212,7 @@ ${lanes.join("\n")}
|
|
|
55211
55212
|
error2(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol));
|
|
55212
55213
|
}
|
|
55213
55214
|
}
|
|
55214
|
-
return
|
|
55215
|
+
return anyType;
|
|
55215
55216
|
}
|
|
55216
55217
|
function getTypeOfSymbolWithDeferredType(symbol) {
|
|
55217
55218
|
const links = getSymbolLinks(symbol);
|
|
@@ -57972,7 +57973,7 @@ ${lanes.join("\n")}
|
|
|
57972
57973
|
}
|
|
57973
57974
|
}
|
|
57974
57975
|
}
|
|
57975
|
-
type =
|
|
57976
|
+
type = anyType;
|
|
57976
57977
|
}
|
|
57977
57978
|
signature.resolvedReturnType = type;
|
|
57978
57979
|
}
|
|
@@ -59472,7 +59473,7 @@ ${lanes.join("\n")}
|
|
|
59472
59473
|
}
|
|
59473
59474
|
}
|
|
59474
59475
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
59475
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)
|
|
59476
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
59476
59477
|
if (templates.length) {
|
|
59477
59478
|
let i = types.length;
|
|
59478
59479
|
while (i > 0) {
|
|
@@ -59872,19 +59873,14 @@ ${lanes.join("\n")}
|
|
|
59872
59873
|
function getConstituentCountOfTypes(types) {
|
|
59873
59874
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
59874
59875
|
}
|
|
59875
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
59876
|
-
if (types.length !== 2) {
|
|
59877
|
-
return false;
|
|
59878
|
-
}
|
|
59879
|
-
const [t1, t2] = types;
|
|
59880
|
-
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
59881
|
-
}
|
|
59882
59876
|
function getTypeFromIntersectionTypeNode(node) {
|
|
59883
59877
|
const links = getNodeLinks(node);
|
|
59884
59878
|
if (!links.resolvedType) {
|
|
59885
59879
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
59886
59880
|
const types = map(node.types, getTypeFromTypeNode);
|
|
59887
|
-
const
|
|
59881
|
+
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
59882
|
+
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
59883
|
+
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
59888
59884
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
59889
59885
|
}
|
|
59890
59886
|
return links.resolvedType;
|
|
@@ -60096,11 +60092,6 @@ ${lanes.join("\n")}
|
|
|
60096
60092
|
}
|
|
60097
60093
|
function createTemplateLiteralType(texts, types) {
|
|
60098
60094
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
60099
|
-
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
60100
|
-
types,
|
|
60101
|
-
/*excludeKinds*/
|
|
60102
|
-
98304 /* Nullable */
|
|
60103
|
-
);
|
|
60104
60095
|
type.texts = texts;
|
|
60105
60096
|
type.types = types;
|
|
60106
60097
|
return type;
|
|
@@ -60395,7 +60386,15 @@ ${lanes.join("\n")}
|
|
|
60395
60386
|
}
|
|
60396
60387
|
function isPatternLiteralPlaceholderType(type) {
|
|
60397
60388
|
if (type.flags & 2097152 /* Intersection */) {
|
|
60398
|
-
|
|
60389
|
+
let seenPlaceholder = false;
|
|
60390
|
+
for (const t of type.types) {
|
|
60391
|
+
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
|
|
60392
|
+
seenPlaceholder = true;
|
|
60393
|
+
} else if (!(t.flags & 524288 /* Object */)) {
|
|
60394
|
+
return false;
|
|
60395
|
+
}
|
|
60396
|
+
}
|
|
60397
|
+
return seenPlaceholder;
|
|
60399
60398
|
}
|
|
60400
60399
|
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
60401
60400
|
}
|
|
@@ -60412,7 +60411,7 @@ ${lanes.join("\n")}
|
|
|
60412
60411
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
60413
60412
|
}
|
|
60414
60413
|
function getGenericObjectFlags(type) {
|
|
60415
|
-
if (type.flags &
|
|
60414
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
60416
60415
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
60417
60416
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
60418
60417
|
}
|
|
@@ -60424,7 +60423,7 @@ ${lanes.join("\n")}
|
|
|
60424
60423
|
}
|
|
60425
60424
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
60426
60425
|
}
|
|
60427
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
60426
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
60428
60427
|
}
|
|
60429
60428
|
function getSimplifiedType(type, writing) {
|
|
60430
60429
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -61450,7 +61449,7 @@ ${lanes.join("\n")}
|
|
|
61450
61449
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
61451
61450
|
target.instantiations.set(id, result);
|
|
61452
61451
|
const resultObjectFlags = getObjectFlags(result);
|
|
61453
|
-
if (result.flags &
|
|
61452
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
61454
61453
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
61455
61454
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
61456
61455
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -66166,8 +66165,8 @@ ${lanes.join("\n")}
|
|
|
66166
66165
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
66167
66166
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
66168
66167
|
}
|
|
66169
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags &
|
|
66170
|
-
if (type.flags &
|
|
66168
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
66169
|
+
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
66171
66170
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
66172
66171
|
}
|
|
66173
66172
|
return result;
|
|
@@ -158146,6 +158145,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
158146
158145
|
if (!info || uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === 1 /* Global */ && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) {
|
|
158147
158146
|
continue;
|
|
158148
158147
|
}
|
|
158148
|
+
if (!isTypeOnlyLocation && isInJSFile(sourceFile) && symbolAppearsToBeTypeOnly(symbol)) {
|
|
158149
|
+
continue;
|
|
158150
|
+
}
|
|
158149
158151
|
const { name, needsConvertPropertyAccess } = info;
|
|
158150
158152
|
const originalSortText = (symbolToSortTextMap == null ? void 0 : symbolToSortTextMap[getSymbolId(symbol)]) ?? SortText.LocationPriority;
|
|
158151
158153
|
const sortText = isDeprecated(symbol, typeChecker) ? SortText.Deprecated(originalSortText) : originalSortText;
|
|
@@ -158225,6 +158227,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
158225
158227
|
}
|
|
158226
158228
|
return !!(allFlags & 111551 /* Value */);
|
|
158227
158229
|
}
|
|
158230
|
+
function symbolAppearsToBeTypeOnly(symbol) {
|
|
158231
|
+
var _a;
|
|
158232
|
+
return !(symbol.flags & 111551 /* Value */) && (!isInJSFile((_a = symbol.declarations) == null ? void 0 : _a[0]) || !!(symbol.flags & 788968 /* Type */));
|
|
158233
|
+
}
|
|
158228
158234
|
}
|
|
158229
158235
|
function getLabelCompletionAtPosition(node) {
|
|
158230
158236
|
const entries = getLabelStatementCompletions(node);
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.4";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20231117`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -3112,7 +3112,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3112
3112
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
3113
3113
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
3114
3114
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
3115
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
3115
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
3116
3116
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
3117
3117
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
3118
3118
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
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.4.0-pr-
|
|
5
|
+
"version": "5.4.0-pr-56434-11",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"node": "20.1.0",
|
|
116
116
|
"npm": "8.19.4"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "15f9713a24b3e7e5254f4e5eac443fea87ab042c"
|
|
119
119
|
}
|