@typescript-deploys/pr-build 5.1.0-pr-53258-7 → 5.1.0-pr-52609-5
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 +52 -28
- package/lib/tsserver.js +52 -28
- package/lib/tsserverlibrary.js +52 -28
- package/lib/typescript.js +52 -28
- package/lib/typingsInstaller.js +1 -1
- package/package.json +3 -2
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.1";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230315`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -45969,6 +45969,10 @@ function createTypeChecker(host) {
|
|
|
45969
45969
|
return;
|
|
45970
45970
|
merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
|
|
45971
45971
|
});
|
|
45972
|
+
if (merged === exported) {
|
|
45973
|
+
getSymbolLinks(merged).resolvedExports = void 0;
|
|
45974
|
+
getSymbolLinks(merged).resolvedMembers = void 0;
|
|
45975
|
+
}
|
|
45972
45976
|
getSymbolLinks(merged).cjsExportMerged = merged;
|
|
45973
45977
|
return links.cjsExportMerged = merged;
|
|
45974
45978
|
}
|
|
@@ -49422,7 +49426,8 @@ function createTypeChecker(host) {
|
|
|
49422
49426
|
), modifierFlags);
|
|
49423
49427
|
}
|
|
49424
49428
|
function getNamespaceMembersForSerialization(symbol) {
|
|
49425
|
-
|
|
49429
|
+
const exports = getExportsOfSymbol(symbol);
|
|
49430
|
+
return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
49426
49431
|
}
|
|
49427
49432
|
function isTypeOnlyNamespace(symbol) {
|
|
49428
49433
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -53225,9 +53230,10 @@ function createTypeChecker(host) {
|
|
|
53225
53230
|
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
53226
53231
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
53227
53232
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
53228
|
-
const
|
|
53229
|
-
const
|
|
53230
|
-
const
|
|
53233
|
+
const mappedType = type.target || type;
|
|
53234
|
+
const nameType = getNameTypeFromMappedType(mappedType);
|
|
53235
|
+
const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
|
|
53236
|
+
const templateType = getTemplateTypeFromMappedType(mappedType);
|
|
53231
53237
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
53232
53238
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
53233
53239
|
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
|
|
@@ -53264,7 +53270,7 @@ function createTypeChecker(host) {
|
|
|
53264
53270
|
prop.links.keyType = keyType;
|
|
53265
53271
|
if (modifiersProp) {
|
|
53266
53272
|
prop.links.syntheticOrigin = modifiersProp;
|
|
53267
|
-
prop.declarations =
|
|
53273
|
+
prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
|
|
53268
53274
|
}
|
|
53269
53275
|
members.set(propName, prop);
|
|
53270
53276
|
}
|
|
@@ -53370,6 +53376,10 @@ function createTypeChecker(host) {
|
|
|
53370
53376
|
}
|
|
53371
53377
|
return false;
|
|
53372
53378
|
}
|
|
53379
|
+
function isFilteringMappedType(type) {
|
|
53380
|
+
const nameType = getNameTypeFromMappedType(type);
|
|
53381
|
+
return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
|
|
53382
|
+
}
|
|
53373
53383
|
function resolveStructuredTypeMembers(type) {
|
|
53374
53384
|
if (!type.members) {
|
|
53375
53385
|
if (type.flags & 524288 /* Object */) {
|
|
@@ -53729,7 +53739,7 @@ function createTypeChecker(host) {
|
|
|
53729
53739
|
const typeVariable = getHomomorphicTypeVariable(type);
|
|
53730
53740
|
if (typeVariable && !type.declaration.nameType) {
|
|
53731
53741
|
const constraint = getConstraintOfTypeParameter(typeVariable);
|
|
53732
|
-
if (constraint &&
|
|
53742
|
+
if (constraint && isArrayType(constraint)) {
|
|
53733
53743
|
return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
|
|
53734
53744
|
}
|
|
53735
53745
|
}
|
|
@@ -56909,8 +56919,7 @@ function createTypeChecker(host) {
|
|
|
56909
56919
|
}
|
|
56910
56920
|
}
|
|
56911
56921
|
if (isGenericMappedType(objectType)) {
|
|
56912
|
-
|
|
56913
|
-
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
56922
|
+
if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
|
|
56914
56923
|
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
|
|
56915
56924
|
}
|
|
56916
56925
|
}
|
|
@@ -58866,12 +58875,7 @@ function createTypeChecker(host) {
|
|
|
58866
58875
|
const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
|
|
58867
58876
|
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
|
|
58868
58877
|
for (let i = 0; i < paramCount; i++) {
|
|
58869
|
-
const sourceType = i === restIndex ? getRestTypeAtPosition(
|
|
58870
|
-
source,
|
|
58871
|
-
i,
|
|
58872
|
-
/*readonly*/
|
|
58873
|
-
true
|
|
58874
|
-
) : tryGetTypeAtPosition(source, i);
|
|
58878
|
+
const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
|
|
58875
58879
|
const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
58876
58880
|
if (sourceType && targetType) {
|
|
58877
58881
|
const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
@@ -67660,7 +67664,7 @@ function createTypeChecker(host) {
|
|
|
67660
67664
|
}
|
|
67661
67665
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
67662
67666
|
const attributes = openingLikeElement.attributes;
|
|
67663
|
-
const
|
|
67667
|
+
const contextualType = getContextualType(attributes, 0 /* None */);
|
|
67664
67668
|
const allAttributesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
67665
67669
|
let attributesTable = createSymbolTable();
|
|
67666
67670
|
let spread = emptyJsxObjectType;
|
|
@@ -67687,12 +67691,18 @@ function createTypeChecker(host) {
|
|
|
67687
67691
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
67688
67692
|
explicitlySpecifyChildrenAttribute = true;
|
|
67689
67693
|
}
|
|
67690
|
-
if (
|
|
67691
|
-
const prop = getPropertyOfType(
|
|
67694
|
+
if (contextualType) {
|
|
67695
|
+
const prop = getPropertyOfType(contextualType, member.escapedName);
|
|
67692
67696
|
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
67693
67697
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
67694
67698
|
}
|
|
67695
67699
|
}
|
|
67700
|
+
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
|
|
67701
|
+
const inferenceContext = getInferenceContext(attributes);
|
|
67702
|
+
Debug.assert(inferenceContext);
|
|
67703
|
+
const inferenceNode = attributeDecl.initializer.expression;
|
|
67704
|
+
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType);
|
|
67705
|
+
}
|
|
67696
67706
|
} else {
|
|
67697
67707
|
Debug.assert(attributeDecl.kind === 291 /* JsxSpreadAttribute */);
|
|
67698
67708
|
if (attributesTable.size > 0) {
|
|
@@ -67747,12 +67757,12 @@ function createTypeChecker(host) {
|
|
|
67747
67757
|
if (explicitlySpecifyChildrenAttribute) {
|
|
67748
67758
|
error(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName));
|
|
67749
67759
|
}
|
|
67750
|
-
const
|
|
67760
|
+
const contextualType2 = getApparentTypeOfContextualType(
|
|
67751
67761
|
openingLikeElement.attributes,
|
|
67752
67762
|
/*contextFlags*/
|
|
67753
67763
|
void 0
|
|
67754
67764
|
);
|
|
67755
|
-
const childrenContextualType =
|
|
67765
|
+
const childrenContextualType = contextualType2 && getTypeOfPropertyOfContextualType(contextualType2, jsxChildrenPropertyName);
|
|
67756
67766
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
67757
67767
|
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
67758
67768
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(
|
|
@@ -71356,12 +71366,12 @@ function createTypeChecker(host) {
|
|
|
71356
71366
|
}
|
|
71357
71367
|
return void 0;
|
|
71358
71368
|
}
|
|
71359
|
-
function getRestTypeAtPosition(source, pos
|
|
71369
|
+
function getRestTypeAtPosition(source, pos) {
|
|
71360
71370
|
const parameterCount = getParameterCount(source);
|
|
71361
71371
|
const minArgumentCount = getMinArgumentCount(source);
|
|
71362
71372
|
const restType = getEffectiveRestType(source);
|
|
71363
71373
|
if (restType && pos >= parameterCount - 1) {
|
|
71364
|
-
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType)
|
|
71374
|
+
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType));
|
|
71365
71375
|
}
|
|
71366
71376
|
const types = [];
|
|
71367
71377
|
const flags = [];
|
|
@@ -71379,7 +71389,13 @@ function createTypeChecker(host) {
|
|
|
71379
71389
|
names.push(name);
|
|
71380
71390
|
}
|
|
71381
71391
|
}
|
|
71382
|
-
return createTupleType(
|
|
71392
|
+
return createTupleType(
|
|
71393
|
+
types,
|
|
71394
|
+
flags,
|
|
71395
|
+
/*readonly*/
|
|
71396
|
+
false,
|
|
71397
|
+
length(names) === length(types) ? names : void 0
|
|
71398
|
+
);
|
|
71383
71399
|
}
|
|
71384
71400
|
function getParameterCount(signature) {
|
|
71385
71401
|
const length2 = signature.parameters.length;
|
|
@@ -72179,6 +72195,11 @@ function createTypeChecker(host) {
|
|
|
72179
72195
|
} else {
|
|
72180
72196
|
assignNonContextualParameterTypes(signature);
|
|
72181
72197
|
}
|
|
72198
|
+
} else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) {
|
|
72199
|
+
const inferenceContext = getInferenceContext(node);
|
|
72200
|
+
if (checkMode && checkMode & 2 /* Inferential */) {
|
|
72201
|
+
inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
|
|
72202
|
+
}
|
|
72182
72203
|
}
|
|
72183
72204
|
if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
|
|
72184
72205
|
const returnType = getReturnTypeFromBody(node, checkMode);
|
|
@@ -103931,7 +103952,7 @@ function transformNodeModule(context) {
|
|
|
103931
103952
|
|
|
103932
103953
|
// src/compiler/transformers/declarations/diagnostics.ts
|
|
103933
103954
|
function canProduceDiagnostics(node) {
|
|
103934
|
-
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
|
|
103955
|
+
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
|
|
103935
103956
|
}
|
|
103936
103957
|
function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
103937
103958
|
if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
@@ -103977,7 +103998,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
|
103977
103998
|
}
|
|
103978
103999
|
}
|
|
103979
104000
|
function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
103980
|
-
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
104001
|
+
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
103981
104002
|
return getVariableDeclarationTypeVisibilityError;
|
|
103982
104003
|
} else if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
103983
104004
|
return getAccessorDeclarationTypeVisibilityError;
|
|
@@ -104002,7 +104023,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
104002
104023
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
104003
104024
|
if (node.kind === 258 /* VariableDeclaration */ || node.kind === 206 /* BindingElement */) {
|
|
104004
104025
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
104005
|
-
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
104026
|
+
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 210 /* ElementAccessExpression */ || node.kind === 224 /* BinaryExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
104006
104027
|
if (isStatic(node)) {
|
|
104007
104028
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
|
|
104008
104029
|
} else if (node.parent.kind === 261 /* ClassDeclaration */ || node.kind === 167 /* Parameter */) {
|
|
@@ -105455,13 +105476,16 @@ function transformDeclarations(context) {
|
|
|
105455
105476
|
fakespace.symbol = props[0].parent;
|
|
105456
105477
|
const exportMappings = [];
|
|
105457
105478
|
let declarations = mapDefined(props, (p) => {
|
|
105458
|
-
if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
|
|
105479
|
+
if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
|
|
105480
|
+
return void 0;
|
|
105481
|
+
}
|
|
105482
|
+
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
105483
|
+
if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
|
|
105459
105484
|
return void 0;
|
|
105460
105485
|
}
|
|
105461
105486
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
|
|
105462
105487
|
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
105463
105488
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
105464
|
-
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
105465
105489
|
const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
|
|
105466
105490
|
const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
|
|
105467
105491
|
if (isNonContextualKeywordName) {
|
package/lib/tsserver.js
CHANGED
|
@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2285
2285
|
|
|
2286
2286
|
// src/compiler/corePublic.ts
|
|
2287
2287
|
var versionMajorMinor = "5.1";
|
|
2288
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2288
|
+
var version = `${versionMajorMinor}.0-insiders.20230315`;
|
|
2289
2289
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2290
2290
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2291
2291
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -50566,6 +50566,10 @@ function createTypeChecker(host) {
|
|
|
50566
50566
|
return;
|
|
50567
50567
|
merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
|
|
50568
50568
|
});
|
|
50569
|
+
if (merged === exported) {
|
|
50570
|
+
getSymbolLinks(merged).resolvedExports = void 0;
|
|
50571
|
+
getSymbolLinks(merged).resolvedMembers = void 0;
|
|
50572
|
+
}
|
|
50569
50573
|
getSymbolLinks(merged).cjsExportMerged = merged;
|
|
50570
50574
|
return links.cjsExportMerged = merged;
|
|
50571
50575
|
}
|
|
@@ -54019,7 +54023,8 @@ function createTypeChecker(host) {
|
|
|
54019
54023
|
), modifierFlags);
|
|
54020
54024
|
}
|
|
54021
54025
|
function getNamespaceMembersForSerialization(symbol) {
|
|
54022
|
-
|
|
54026
|
+
const exports = getExportsOfSymbol(symbol);
|
|
54027
|
+
return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
54023
54028
|
}
|
|
54024
54029
|
function isTypeOnlyNamespace(symbol) {
|
|
54025
54030
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -57822,9 +57827,10 @@ function createTypeChecker(host) {
|
|
|
57822
57827
|
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
57823
57828
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
57824
57829
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
57825
|
-
const
|
|
57826
|
-
const
|
|
57827
|
-
const
|
|
57830
|
+
const mappedType = type.target || type;
|
|
57831
|
+
const nameType = getNameTypeFromMappedType(mappedType);
|
|
57832
|
+
const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
|
|
57833
|
+
const templateType = getTemplateTypeFromMappedType(mappedType);
|
|
57828
57834
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
57829
57835
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
57830
57836
|
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
|
|
@@ -57861,7 +57867,7 @@ function createTypeChecker(host) {
|
|
|
57861
57867
|
prop.links.keyType = keyType;
|
|
57862
57868
|
if (modifiersProp) {
|
|
57863
57869
|
prop.links.syntheticOrigin = modifiersProp;
|
|
57864
|
-
prop.declarations =
|
|
57870
|
+
prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
|
|
57865
57871
|
}
|
|
57866
57872
|
members.set(propName, prop);
|
|
57867
57873
|
}
|
|
@@ -57967,6 +57973,10 @@ function createTypeChecker(host) {
|
|
|
57967
57973
|
}
|
|
57968
57974
|
return false;
|
|
57969
57975
|
}
|
|
57976
|
+
function isFilteringMappedType(type) {
|
|
57977
|
+
const nameType = getNameTypeFromMappedType(type);
|
|
57978
|
+
return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
|
|
57979
|
+
}
|
|
57970
57980
|
function resolveStructuredTypeMembers(type) {
|
|
57971
57981
|
if (!type.members) {
|
|
57972
57982
|
if (type.flags & 524288 /* Object */) {
|
|
@@ -58326,7 +58336,7 @@ function createTypeChecker(host) {
|
|
|
58326
58336
|
const typeVariable = getHomomorphicTypeVariable(type);
|
|
58327
58337
|
if (typeVariable && !type.declaration.nameType) {
|
|
58328
58338
|
const constraint = getConstraintOfTypeParameter(typeVariable);
|
|
58329
|
-
if (constraint &&
|
|
58339
|
+
if (constraint && isArrayType(constraint)) {
|
|
58330
58340
|
return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
|
|
58331
58341
|
}
|
|
58332
58342
|
}
|
|
@@ -61506,8 +61516,7 @@ function createTypeChecker(host) {
|
|
|
61506
61516
|
}
|
|
61507
61517
|
}
|
|
61508
61518
|
if (isGenericMappedType(objectType)) {
|
|
61509
|
-
|
|
61510
|
-
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
61519
|
+
if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
|
|
61511
61520
|
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
|
|
61512
61521
|
}
|
|
61513
61522
|
}
|
|
@@ -63463,12 +63472,7 @@ function createTypeChecker(host) {
|
|
|
63463
63472
|
const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
|
|
63464
63473
|
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
|
|
63465
63474
|
for (let i = 0; i < paramCount; i++) {
|
|
63466
|
-
const sourceType = i === restIndex ? getRestTypeAtPosition(
|
|
63467
|
-
source,
|
|
63468
|
-
i,
|
|
63469
|
-
/*readonly*/
|
|
63470
|
-
true
|
|
63471
|
-
) : tryGetTypeAtPosition(source, i);
|
|
63475
|
+
const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
|
|
63472
63476
|
const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
63473
63477
|
if (sourceType && targetType) {
|
|
63474
63478
|
const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
@@ -72257,7 +72261,7 @@ function createTypeChecker(host) {
|
|
|
72257
72261
|
}
|
|
72258
72262
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
72259
72263
|
const attributes = openingLikeElement.attributes;
|
|
72260
|
-
const
|
|
72264
|
+
const contextualType = getContextualType2(attributes, 0 /* None */);
|
|
72261
72265
|
const allAttributesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
72262
72266
|
let attributesTable = createSymbolTable();
|
|
72263
72267
|
let spread = emptyJsxObjectType;
|
|
@@ -72284,12 +72288,18 @@ function createTypeChecker(host) {
|
|
|
72284
72288
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
72285
72289
|
explicitlySpecifyChildrenAttribute = true;
|
|
72286
72290
|
}
|
|
72287
|
-
if (
|
|
72288
|
-
const prop = getPropertyOfType(
|
|
72291
|
+
if (contextualType) {
|
|
72292
|
+
const prop = getPropertyOfType(contextualType, member.escapedName);
|
|
72289
72293
|
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
72290
72294
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
72291
72295
|
}
|
|
72292
72296
|
}
|
|
72297
|
+
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
|
|
72298
|
+
const inferenceContext = getInferenceContext(attributes);
|
|
72299
|
+
Debug.assert(inferenceContext);
|
|
72300
|
+
const inferenceNode = attributeDecl.initializer.expression;
|
|
72301
|
+
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType);
|
|
72302
|
+
}
|
|
72293
72303
|
} else {
|
|
72294
72304
|
Debug.assert(attributeDecl.kind === 291 /* JsxSpreadAttribute */);
|
|
72295
72305
|
if (attributesTable.size > 0) {
|
|
@@ -72344,12 +72354,12 @@ function createTypeChecker(host) {
|
|
|
72344
72354
|
if (explicitlySpecifyChildrenAttribute) {
|
|
72345
72355
|
error(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName));
|
|
72346
72356
|
}
|
|
72347
|
-
const
|
|
72357
|
+
const contextualType2 = getApparentTypeOfContextualType(
|
|
72348
72358
|
openingLikeElement.attributes,
|
|
72349
72359
|
/*contextFlags*/
|
|
72350
72360
|
void 0
|
|
72351
72361
|
);
|
|
72352
|
-
const childrenContextualType =
|
|
72362
|
+
const childrenContextualType = contextualType2 && getTypeOfPropertyOfContextualType(contextualType2, jsxChildrenPropertyName);
|
|
72353
72363
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
72354
72364
|
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
72355
72365
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(
|
|
@@ -75953,12 +75963,12 @@ function createTypeChecker(host) {
|
|
|
75953
75963
|
}
|
|
75954
75964
|
return void 0;
|
|
75955
75965
|
}
|
|
75956
|
-
function getRestTypeAtPosition(source, pos
|
|
75966
|
+
function getRestTypeAtPosition(source, pos) {
|
|
75957
75967
|
const parameterCount = getParameterCount(source);
|
|
75958
75968
|
const minArgumentCount = getMinArgumentCount(source);
|
|
75959
75969
|
const restType = getEffectiveRestType(source);
|
|
75960
75970
|
if (restType && pos >= parameterCount - 1) {
|
|
75961
|
-
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType)
|
|
75971
|
+
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType));
|
|
75962
75972
|
}
|
|
75963
75973
|
const types = [];
|
|
75964
75974
|
const flags = [];
|
|
@@ -75976,7 +75986,13 @@ function createTypeChecker(host) {
|
|
|
75976
75986
|
names.push(name);
|
|
75977
75987
|
}
|
|
75978
75988
|
}
|
|
75979
|
-
return createTupleType(
|
|
75989
|
+
return createTupleType(
|
|
75990
|
+
types,
|
|
75991
|
+
flags,
|
|
75992
|
+
/*readonly*/
|
|
75993
|
+
false,
|
|
75994
|
+
length(names) === length(types) ? names : void 0
|
|
75995
|
+
);
|
|
75980
75996
|
}
|
|
75981
75997
|
function getParameterCount(signature) {
|
|
75982
75998
|
const length2 = signature.parameters.length;
|
|
@@ -76776,6 +76792,11 @@ function createTypeChecker(host) {
|
|
|
76776
76792
|
} else {
|
|
76777
76793
|
assignNonContextualParameterTypes(signature);
|
|
76778
76794
|
}
|
|
76795
|
+
} else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) {
|
|
76796
|
+
const inferenceContext = getInferenceContext(node);
|
|
76797
|
+
if (checkMode && checkMode & 2 /* Inferential */) {
|
|
76798
|
+
inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
|
|
76799
|
+
}
|
|
76779
76800
|
}
|
|
76780
76801
|
if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
|
|
76781
76802
|
const returnType = getReturnTypeFromBody(node, checkMode);
|
|
@@ -108699,7 +108720,7 @@ function transformNodeModule(context) {
|
|
|
108699
108720
|
|
|
108700
108721
|
// src/compiler/transformers/declarations/diagnostics.ts
|
|
108701
108722
|
function canProduceDiagnostics(node) {
|
|
108702
|
-
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
|
|
108723
|
+
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
|
|
108703
108724
|
}
|
|
108704
108725
|
function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
108705
108726
|
if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
@@ -108745,7 +108766,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
|
108745
108766
|
}
|
|
108746
108767
|
}
|
|
108747
108768
|
function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
108748
|
-
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
108769
|
+
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
108749
108770
|
return getVariableDeclarationTypeVisibilityError;
|
|
108750
108771
|
} else if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
108751
108772
|
return getAccessorDeclarationTypeVisibilityError;
|
|
@@ -108770,7 +108791,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
108770
108791
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
108771
108792
|
if (node.kind === 258 /* VariableDeclaration */ || node.kind === 206 /* BindingElement */) {
|
|
108772
108793
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
108773
|
-
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
108794
|
+
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 210 /* ElementAccessExpression */ || node.kind === 224 /* BinaryExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
108774
108795
|
if (isStatic(node)) {
|
|
108775
108796
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
|
|
108776
108797
|
} else if (node.parent.kind === 261 /* ClassDeclaration */ || node.kind === 167 /* Parameter */) {
|
|
@@ -110223,13 +110244,16 @@ function transformDeclarations(context) {
|
|
|
110223
110244
|
fakespace.symbol = props[0].parent;
|
|
110224
110245
|
const exportMappings = [];
|
|
110225
110246
|
let declarations = mapDefined(props, (p) => {
|
|
110226
|
-
if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
|
|
110247
|
+
if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
|
|
110248
|
+
return void 0;
|
|
110249
|
+
}
|
|
110250
|
+
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
110251
|
+
if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
|
|
110227
110252
|
return void 0;
|
|
110228
110253
|
}
|
|
110229
110254
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
|
|
110230
110255
|
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
110231
110256
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
110232
|
-
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
110233
110257
|
const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
|
|
110234
110258
|
const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
|
|
110235
110259
|
if (isNonContextualKeywordName) {
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230315`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -48377,6 +48377,10 @@ ${lanes.join("\n")}
|
|
|
48377
48377
|
return;
|
|
48378
48378
|
merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
|
|
48379
48379
|
});
|
|
48380
|
+
if (merged === exported) {
|
|
48381
|
+
getSymbolLinks(merged).resolvedExports = void 0;
|
|
48382
|
+
getSymbolLinks(merged).resolvedMembers = void 0;
|
|
48383
|
+
}
|
|
48380
48384
|
getSymbolLinks(merged).cjsExportMerged = merged;
|
|
48381
48385
|
return links.cjsExportMerged = merged;
|
|
48382
48386
|
}
|
|
@@ -51830,7 +51834,8 @@ ${lanes.join("\n")}
|
|
|
51830
51834
|
), modifierFlags);
|
|
51831
51835
|
}
|
|
51832
51836
|
function getNamespaceMembersForSerialization(symbol) {
|
|
51833
|
-
|
|
51837
|
+
const exports = getExportsOfSymbol(symbol);
|
|
51838
|
+
return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
51834
51839
|
}
|
|
51835
51840
|
function isTypeOnlyNamespace(symbol) {
|
|
51836
51841
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -55633,9 +55638,10 @@ ${lanes.join("\n")}
|
|
|
55633
55638
|
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
55634
55639
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
55635
55640
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
55636
|
-
const
|
|
55637
|
-
const
|
|
55638
|
-
const
|
|
55641
|
+
const mappedType = type.target || type;
|
|
55642
|
+
const nameType = getNameTypeFromMappedType(mappedType);
|
|
55643
|
+
const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
|
|
55644
|
+
const templateType = getTemplateTypeFromMappedType(mappedType);
|
|
55639
55645
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
55640
55646
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
55641
55647
|
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
|
|
@@ -55672,7 +55678,7 @@ ${lanes.join("\n")}
|
|
|
55672
55678
|
prop.links.keyType = keyType;
|
|
55673
55679
|
if (modifiersProp) {
|
|
55674
55680
|
prop.links.syntheticOrigin = modifiersProp;
|
|
55675
|
-
prop.declarations =
|
|
55681
|
+
prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
|
|
55676
55682
|
}
|
|
55677
55683
|
members.set(propName, prop);
|
|
55678
55684
|
}
|
|
@@ -55778,6 +55784,10 @@ ${lanes.join("\n")}
|
|
|
55778
55784
|
}
|
|
55779
55785
|
return false;
|
|
55780
55786
|
}
|
|
55787
|
+
function isFilteringMappedType(type) {
|
|
55788
|
+
const nameType = getNameTypeFromMappedType(type);
|
|
55789
|
+
return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
|
|
55790
|
+
}
|
|
55781
55791
|
function resolveStructuredTypeMembers(type) {
|
|
55782
55792
|
if (!type.members) {
|
|
55783
55793
|
if (type.flags & 524288 /* Object */) {
|
|
@@ -56137,7 +56147,7 @@ ${lanes.join("\n")}
|
|
|
56137
56147
|
const typeVariable = getHomomorphicTypeVariable(type);
|
|
56138
56148
|
if (typeVariable && !type.declaration.nameType) {
|
|
56139
56149
|
const constraint = getConstraintOfTypeParameter(typeVariable);
|
|
56140
|
-
if (constraint &&
|
|
56150
|
+
if (constraint && isArrayType(constraint)) {
|
|
56141
56151
|
return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
|
|
56142
56152
|
}
|
|
56143
56153
|
}
|
|
@@ -59317,8 +59327,7 @@ ${lanes.join("\n")}
|
|
|
59317
59327
|
}
|
|
59318
59328
|
}
|
|
59319
59329
|
if (isGenericMappedType(objectType)) {
|
|
59320
|
-
|
|
59321
|
-
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
59330
|
+
if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
|
|
59322
59331
|
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
|
|
59323
59332
|
}
|
|
59324
59333
|
}
|
|
@@ -61274,12 +61283,7 @@ ${lanes.join("\n")}
|
|
|
61274
61283
|
const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
|
|
61275
61284
|
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
|
|
61276
61285
|
for (let i = 0; i < paramCount; i++) {
|
|
61277
|
-
const sourceType = i === restIndex ? getRestTypeAtPosition(
|
|
61278
|
-
source,
|
|
61279
|
-
i,
|
|
61280
|
-
/*readonly*/
|
|
61281
|
-
true
|
|
61282
|
-
) : tryGetTypeAtPosition(source, i);
|
|
61286
|
+
const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
|
|
61283
61287
|
const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
61284
61288
|
if (sourceType && targetType) {
|
|
61285
61289
|
const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
@@ -70068,7 +70072,7 @@ ${lanes.join("\n")}
|
|
|
70068
70072
|
}
|
|
70069
70073
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
70070
70074
|
const attributes = openingLikeElement.attributes;
|
|
70071
|
-
const
|
|
70075
|
+
const contextualType = getContextualType2(attributes, 0 /* None */);
|
|
70072
70076
|
const allAttributesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
70073
70077
|
let attributesTable = createSymbolTable();
|
|
70074
70078
|
let spread = emptyJsxObjectType;
|
|
@@ -70095,12 +70099,18 @@ ${lanes.join("\n")}
|
|
|
70095
70099
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
70096
70100
|
explicitlySpecifyChildrenAttribute = true;
|
|
70097
70101
|
}
|
|
70098
|
-
if (
|
|
70099
|
-
const prop = getPropertyOfType(
|
|
70102
|
+
if (contextualType) {
|
|
70103
|
+
const prop = getPropertyOfType(contextualType, member.escapedName);
|
|
70100
70104
|
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
70101
70105
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
70102
70106
|
}
|
|
70103
70107
|
}
|
|
70108
|
+
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
|
|
70109
|
+
const inferenceContext = getInferenceContext(attributes);
|
|
70110
|
+
Debug.assert(inferenceContext);
|
|
70111
|
+
const inferenceNode = attributeDecl.initializer.expression;
|
|
70112
|
+
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType);
|
|
70113
|
+
}
|
|
70104
70114
|
} else {
|
|
70105
70115
|
Debug.assert(attributeDecl.kind === 291 /* JsxSpreadAttribute */);
|
|
70106
70116
|
if (attributesTable.size > 0) {
|
|
@@ -70155,12 +70165,12 @@ ${lanes.join("\n")}
|
|
|
70155
70165
|
if (explicitlySpecifyChildrenAttribute) {
|
|
70156
70166
|
error(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName));
|
|
70157
70167
|
}
|
|
70158
|
-
const
|
|
70168
|
+
const contextualType2 = getApparentTypeOfContextualType(
|
|
70159
70169
|
openingLikeElement.attributes,
|
|
70160
70170
|
/*contextFlags*/
|
|
70161
70171
|
void 0
|
|
70162
70172
|
);
|
|
70163
|
-
const childrenContextualType =
|
|
70173
|
+
const childrenContextualType = contextualType2 && getTypeOfPropertyOfContextualType(contextualType2, jsxChildrenPropertyName);
|
|
70164
70174
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
70165
70175
|
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
70166
70176
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(
|
|
@@ -73764,12 +73774,12 @@ ${lanes.join("\n")}
|
|
|
73764
73774
|
}
|
|
73765
73775
|
return void 0;
|
|
73766
73776
|
}
|
|
73767
|
-
function getRestTypeAtPosition(source, pos
|
|
73777
|
+
function getRestTypeAtPosition(source, pos) {
|
|
73768
73778
|
const parameterCount = getParameterCount(source);
|
|
73769
73779
|
const minArgumentCount = getMinArgumentCount(source);
|
|
73770
73780
|
const restType = getEffectiveRestType(source);
|
|
73771
73781
|
if (restType && pos >= parameterCount - 1) {
|
|
73772
|
-
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType)
|
|
73782
|
+
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType));
|
|
73773
73783
|
}
|
|
73774
73784
|
const types = [];
|
|
73775
73785
|
const flags = [];
|
|
@@ -73787,7 +73797,13 @@ ${lanes.join("\n")}
|
|
|
73787
73797
|
names.push(name);
|
|
73788
73798
|
}
|
|
73789
73799
|
}
|
|
73790
|
-
return createTupleType(
|
|
73800
|
+
return createTupleType(
|
|
73801
|
+
types,
|
|
73802
|
+
flags,
|
|
73803
|
+
/*readonly*/
|
|
73804
|
+
false,
|
|
73805
|
+
length(names) === length(types) ? names : void 0
|
|
73806
|
+
);
|
|
73791
73807
|
}
|
|
73792
73808
|
function getParameterCount(signature) {
|
|
73793
73809
|
const length2 = signature.parameters.length;
|
|
@@ -74587,6 +74603,11 @@ ${lanes.join("\n")}
|
|
|
74587
74603
|
} else {
|
|
74588
74604
|
assignNonContextualParameterTypes(signature);
|
|
74589
74605
|
}
|
|
74606
|
+
} else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) {
|
|
74607
|
+
const inferenceContext = getInferenceContext(node);
|
|
74608
|
+
if (checkMode && checkMode & 2 /* Inferential */) {
|
|
74609
|
+
inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
|
|
74610
|
+
}
|
|
74590
74611
|
}
|
|
74591
74612
|
if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
|
|
74592
74613
|
const returnType = getReturnTypeFromBody(node, checkMode);
|
|
@@ -106801,7 +106822,7 @@ ${lanes.join("\n")}
|
|
|
106801
106822
|
|
|
106802
106823
|
// src/compiler/transformers/declarations/diagnostics.ts
|
|
106803
106824
|
function canProduceDiagnostics(node) {
|
|
106804
|
-
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
|
|
106825
|
+
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
|
|
106805
106826
|
}
|
|
106806
106827
|
function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
106807
106828
|
if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
@@ -106847,7 +106868,7 @@ ${lanes.join("\n")}
|
|
|
106847
106868
|
}
|
|
106848
106869
|
}
|
|
106849
106870
|
function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
106850
|
-
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
106871
|
+
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
106851
106872
|
return getVariableDeclarationTypeVisibilityError;
|
|
106852
106873
|
} else if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
106853
106874
|
return getAccessorDeclarationTypeVisibilityError;
|
|
@@ -106872,7 +106893,7 @@ ${lanes.join("\n")}
|
|
|
106872
106893
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
106873
106894
|
if (node.kind === 258 /* VariableDeclaration */ || node.kind === 206 /* BindingElement */) {
|
|
106874
106895
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
106875
|
-
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
106896
|
+
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 210 /* ElementAccessExpression */ || node.kind === 224 /* BinaryExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
106876
106897
|
if (isStatic(node)) {
|
|
106877
106898
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
|
|
106878
106899
|
} else if (node.parent.kind === 261 /* ClassDeclaration */ || node.kind === 167 /* Parameter */) {
|
|
@@ -108330,13 +108351,16 @@ ${lanes.join("\n")}
|
|
|
108330
108351
|
fakespace.symbol = props[0].parent;
|
|
108331
108352
|
const exportMappings = [];
|
|
108332
108353
|
let declarations = mapDefined(props, (p) => {
|
|
108333
|
-
if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
|
|
108354
|
+
if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
|
|
108355
|
+
return void 0;
|
|
108356
|
+
}
|
|
108357
|
+
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
108358
|
+
if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
|
|
108334
108359
|
return void 0;
|
|
108335
108360
|
}
|
|
108336
108361
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
|
|
108337
108362
|
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
108338
108363
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
108339
|
-
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
108340
108364
|
const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
|
|
108341
108365
|
const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
|
|
108342
108366
|
if (isNonContextualKeywordName) {
|
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.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230315`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -48377,6 +48377,10 @@ ${lanes.join("\n")}
|
|
|
48377
48377
|
return;
|
|
48378
48378
|
merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
|
|
48379
48379
|
});
|
|
48380
|
+
if (merged === exported) {
|
|
48381
|
+
getSymbolLinks(merged).resolvedExports = void 0;
|
|
48382
|
+
getSymbolLinks(merged).resolvedMembers = void 0;
|
|
48383
|
+
}
|
|
48380
48384
|
getSymbolLinks(merged).cjsExportMerged = merged;
|
|
48381
48385
|
return links.cjsExportMerged = merged;
|
|
48382
48386
|
}
|
|
@@ -51830,7 +51834,8 @@ ${lanes.join("\n")}
|
|
|
51830
51834
|
), modifierFlags);
|
|
51831
51835
|
}
|
|
51832
51836
|
function getNamespaceMembersForSerialization(symbol) {
|
|
51833
|
-
|
|
51837
|
+
const exports = getExportsOfSymbol(symbol);
|
|
51838
|
+
return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
51834
51839
|
}
|
|
51835
51840
|
function isTypeOnlyNamespace(symbol) {
|
|
51836
51841
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -55633,9 +55638,10 @@ ${lanes.join("\n")}
|
|
|
55633
55638
|
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
55634
55639
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
55635
55640
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
55636
|
-
const
|
|
55637
|
-
const
|
|
55638
|
-
const
|
|
55641
|
+
const mappedType = type.target || type;
|
|
55642
|
+
const nameType = getNameTypeFromMappedType(mappedType);
|
|
55643
|
+
const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
|
|
55644
|
+
const templateType = getTemplateTypeFromMappedType(mappedType);
|
|
55639
55645
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
55640
55646
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
55641
55647
|
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
|
|
@@ -55672,7 +55678,7 @@ ${lanes.join("\n")}
|
|
|
55672
55678
|
prop.links.keyType = keyType;
|
|
55673
55679
|
if (modifiersProp) {
|
|
55674
55680
|
prop.links.syntheticOrigin = modifiersProp;
|
|
55675
|
-
prop.declarations =
|
|
55681
|
+
prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
|
|
55676
55682
|
}
|
|
55677
55683
|
members.set(propName, prop);
|
|
55678
55684
|
}
|
|
@@ -55778,6 +55784,10 @@ ${lanes.join("\n")}
|
|
|
55778
55784
|
}
|
|
55779
55785
|
return false;
|
|
55780
55786
|
}
|
|
55787
|
+
function isFilteringMappedType(type) {
|
|
55788
|
+
const nameType = getNameTypeFromMappedType(type);
|
|
55789
|
+
return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
|
|
55790
|
+
}
|
|
55781
55791
|
function resolveStructuredTypeMembers(type) {
|
|
55782
55792
|
if (!type.members) {
|
|
55783
55793
|
if (type.flags & 524288 /* Object */) {
|
|
@@ -56137,7 +56147,7 @@ ${lanes.join("\n")}
|
|
|
56137
56147
|
const typeVariable = getHomomorphicTypeVariable(type);
|
|
56138
56148
|
if (typeVariable && !type.declaration.nameType) {
|
|
56139
56149
|
const constraint = getConstraintOfTypeParameter(typeVariable);
|
|
56140
|
-
if (constraint &&
|
|
56150
|
+
if (constraint && isArrayType(constraint)) {
|
|
56141
56151
|
return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
|
|
56142
56152
|
}
|
|
56143
56153
|
}
|
|
@@ -59317,8 +59327,7 @@ ${lanes.join("\n")}
|
|
|
59317
59327
|
}
|
|
59318
59328
|
}
|
|
59319
59329
|
if (isGenericMappedType(objectType)) {
|
|
59320
|
-
|
|
59321
|
-
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
59330
|
+
if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
|
|
59322
59331
|
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
|
|
59323
59332
|
}
|
|
59324
59333
|
}
|
|
@@ -61274,12 +61283,7 @@ ${lanes.join("\n")}
|
|
|
61274
61283
|
const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
|
|
61275
61284
|
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
|
|
61276
61285
|
for (let i = 0; i < paramCount; i++) {
|
|
61277
|
-
const sourceType = i === restIndex ? getRestTypeAtPosition(
|
|
61278
|
-
source,
|
|
61279
|
-
i,
|
|
61280
|
-
/*readonly*/
|
|
61281
|
-
true
|
|
61282
|
-
) : tryGetTypeAtPosition(source, i);
|
|
61286
|
+
const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
|
|
61283
61287
|
const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
61284
61288
|
if (sourceType && targetType) {
|
|
61285
61289
|
const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
@@ -70068,7 +70072,7 @@ ${lanes.join("\n")}
|
|
|
70068
70072
|
}
|
|
70069
70073
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
70070
70074
|
const attributes = openingLikeElement.attributes;
|
|
70071
|
-
const
|
|
70075
|
+
const contextualType = getContextualType2(attributes, 0 /* None */);
|
|
70072
70076
|
const allAttributesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
70073
70077
|
let attributesTable = createSymbolTable();
|
|
70074
70078
|
let spread = emptyJsxObjectType;
|
|
@@ -70095,12 +70099,18 @@ ${lanes.join("\n")}
|
|
|
70095
70099
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
70096
70100
|
explicitlySpecifyChildrenAttribute = true;
|
|
70097
70101
|
}
|
|
70098
|
-
if (
|
|
70099
|
-
const prop = getPropertyOfType(
|
|
70102
|
+
if (contextualType) {
|
|
70103
|
+
const prop = getPropertyOfType(contextualType, member.escapedName);
|
|
70100
70104
|
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
70101
70105
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
70102
70106
|
}
|
|
70103
70107
|
}
|
|
70108
|
+
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
|
|
70109
|
+
const inferenceContext = getInferenceContext(attributes);
|
|
70110
|
+
Debug.assert(inferenceContext);
|
|
70111
|
+
const inferenceNode = attributeDecl.initializer.expression;
|
|
70112
|
+
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType);
|
|
70113
|
+
}
|
|
70104
70114
|
} else {
|
|
70105
70115
|
Debug.assert(attributeDecl.kind === 291 /* JsxSpreadAttribute */);
|
|
70106
70116
|
if (attributesTable.size > 0) {
|
|
@@ -70155,12 +70165,12 @@ ${lanes.join("\n")}
|
|
|
70155
70165
|
if (explicitlySpecifyChildrenAttribute) {
|
|
70156
70166
|
error(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName));
|
|
70157
70167
|
}
|
|
70158
|
-
const
|
|
70168
|
+
const contextualType2 = getApparentTypeOfContextualType(
|
|
70159
70169
|
openingLikeElement.attributes,
|
|
70160
70170
|
/*contextFlags*/
|
|
70161
70171
|
void 0
|
|
70162
70172
|
);
|
|
70163
|
-
const childrenContextualType =
|
|
70173
|
+
const childrenContextualType = contextualType2 && getTypeOfPropertyOfContextualType(contextualType2, jsxChildrenPropertyName);
|
|
70164
70174
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
70165
70175
|
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
70166
70176
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(
|
|
@@ -73764,12 +73774,12 @@ ${lanes.join("\n")}
|
|
|
73764
73774
|
}
|
|
73765
73775
|
return void 0;
|
|
73766
73776
|
}
|
|
73767
|
-
function getRestTypeAtPosition(source, pos
|
|
73777
|
+
function getRestTypeAtPosition(source, pos) {
|
|
73768
73778
|
const parameterCount = getParameterCount(source);
|
|
73769
73779
|
const minArgumentCount = getMinArgumentCount(source);
|
|
73770
73780
|
const restType = getEffectiveRestType(source);
|
|
73771
73781
|
if (restType && pos >= parameterCount - 1) {
|
|
73772
|
-
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType)
|
|
73782
|
+
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType));
|
|
73773
73783
|
}
|
|
73774
73784
|
const types = [];
|
|
73775
73785
|
const flags = [];
|
|
@@ -73787,7 +73797,13 @@ ${lanes.join("\n")}
|
|
|
73787
73797
|
names.push(name);
|
|
73788
73798
|
}
|
|
73789
73799
|
}
|
|
73790
|
-
return createTupleType(
|
|
73800
|
+
return createTupleType(
|
|
73801
|
+
types,
|
|
73802
|
+
flags,
|
|
73803
|
+
/*readonly*/
|
|
73804
|
+
false,
|
|
73805
|
+
length(names) === length(types) ? names : void 0
|
|
73806
|
+
);
|
|
73791
73807
|
}
|
|
73792
73808
|
function getParameterCount(signature) {
|
|
73793
73809
|
const length2 = signature.parameters.length;
|
|
@@ -74587,6 +74603,11 @@ ${lanes.join("\n")}
|
|
|
74587
74603
|
} else {
|
|
74588
74604
|
assignNonContextualParameterTypes(signature);
|
|
74589
74605
|
}
|
|
74606
|
+
} else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) {
|
|
74607
|
+
const inferenceContext = getInferenceContext(node);
|
|
74608
|
+
if (checkMode && checkMode & 2 /* Inferential */) {
|
|
74609
|
+
inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
|
|
74610
|
+
}
|
|
74590
74611
|
}
|
|
74591
74612
|
if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
|
|
74592
74613
|
const returnType = getReturnTypeFromBody(node, checkMode);
|
|
@@ -106801,7 +106822,7 @@ ${lanes.join("\n")}
|
|
|
106801
106822
|
|
|
106802
106823
|
// src/compiler/transformers/declarations/diagnostics.ts
|
|
106803
106824
|
function canProduceDiagnostics(node) {
|
|
106804
|
-
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
|
|
106825
|
+
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
|
|
106805
106826
|
}
|
|
106806
106827
|
function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
106807
106828
|
if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
@@ -106847,7 +106868,7 @@ ${lanes.join("\n")}
|
|
|
106847
106868
|
}
|
|
106848
106869
|
}
|
|
106849
106870
|
function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
106850
|
-
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
106871
|
+
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
106851
106872
|
return getVariableDeclarationTypeVisibilityError;
|
|
106852
106873
|
} else if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
106853
106874
|
return getAccessorDeclarationTypeVisibilityError;
|
|
@@ -106872,7 +106893,7 @@ ${lanes.join("\n")}
|
|
|
106872
106893
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
106873
106894
|
if (node.kind === 258 /* VariableDeclaration */ || node.kind === 206 /* BindingElement */) {
|
|
106874
106895
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
106875
|
-
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
106896
|
+
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 210 /* ElementAccessExpression */ || node.kind === 224 /* BinaryExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
106876
106897
|
if (isStatic(node)) {
|
|
106877
106898
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
|
|
106878
106899
|
} else if (node.parent.kind === 261 /* ClassDeclaration */ || node.kind === 167 /* Parameter */) {
|
|
@@ -108330,13 +108351,16 @@ ${lanes.join("\n")}
|
|
|
108330
108351
|
fakespace.symbol = props[0].parent;
|
|
108331
108352
|
const exportMappings = [];
|
|
108332
108353
|
let declarations = mapDefined(props, (p) => {
|
|
108333
|
-
if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
|
|
108354
|
+
if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
|
|
108355
|
+
return void 0;
|
|
108356
|
+
}
|
|
108357
|
+
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
108358
|
+
if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
|
|
108334
108359
|
return void 0;
|
|
108335
108360
|
}
|
|
108336
108361
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
|
|
108337
108362
|
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
108338
108363
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
108339
|
-
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
108340
108364
|
const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
|
|
108341
108365
|
const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
|
|
108342
108366
|
if (isNonContextualKeywordName) {
|
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.1";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20230315`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
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.1.0-pr-
|
|
5
|
+
"version": "5.1.0-pr-52609-5",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"ms": "^2.1.3",
|
|
79
79
|
"node-fetch": "^3.2.10",
|
|
80
80
|
"source-map-support": "^0.5.21",
|
|
81
|
+
"tslib": "^2.5.0",
|
|
81
82
|
"typescript": "5.0.1-rc",
|
|
82
83
|
"which": "^2.0.2"
|
|
83
84
|
},
|
|
@@ -113,5 +114,5 @@
|
|
|
113
114
|
"node": "14.21.1",
|
|
114
115
|
"npm": "8.19.3"
|
|
115
116
|
},
|
|
116
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "0c1647226bdcc16d100228106d967756f79dd88f"
|
|
117
118
|
}
|