@typescript-deploys/pr-build 5.0.0-pr-52807-23 → 5.0.0-pr-52818-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 CHANGED
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-insiders.20230216`;
26
+ var version = `${versionMajorMinor}.0-insiders.20230217`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -24988,7 +24988,7 @@ function canHaveIllegalDecorators(node) {
24988
24988
  }
24989
24989
  function canHaveIllegalModifiers(node) {
24990
24990
  const kind = node.kind;
24991
- return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */;
24991
+ return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */;
24992
24992
  }
24993
24993
  function isQuestionOrExclamationToken(node) {
24994
24994
  return isQuestionToken(node) || isExclamationToken(node);
@@ -28280,6 +28280,7 @@ var Parser;
28280
28280
  const hasJSDoc = hasPrecedingJSDocComment();
28281
28281
  const modifiers = parseModifiersForConstructorType();
28282
28282
  const isConstructorType = parseOptional(103 /* NewKeyword */);
28283
+ Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");
28283
28284
  const typeParameters = parseTypeParameters();
28284
28285
  const parameters = parseParameters(4 /* Type */);
28285
28286
  const type = parseReturnType(
@@ -28288,8 +28289,6 @@ var Parser;
28288
28289
  false
28289
28290
  );
28290
28291
  const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
28291
- if (!isConstructorType)
28292
- node.modifiers = modifiers;
28293
28292
  return withJSDoc(finishNode(node, pos), hasJSDoc);
28294
28293
  }
28295
28294
  function parseKeywordAndNoDot() {
@@ -29586,13 +29585,9 @@ var Parser;
29586
29585
  function parseJsxClosingFragment(inExpressionContext) {
29587
29586
  const pos = getNodePos();
29588
29587
  parseExpected(30 /* LessThanSlashToken */);
29589
- if (tokenIsIdentifierOrKeyword(token())) {
29590
- parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
29591
- }
29592
29588
  if (parseExpected(
29593
29589
  31 /* GreaterThanToken */,
29594
- /*diagnostic*/
29595
- void 0,
29590
+ Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment,
29596
29591
  /*shouldAdvance*/
29597
29592
  false
29598
29593
  )) {
@@ -42585,6 +42580,7 @@ function createTypeChecker(host) {
42585
42580
  let inlineLevel = 0;
42586
42581
  let currentNode;
42587
42582
  let varianceTypeParameter;
42583
+ let isInferencePartiallyBlocked = false;
42588
42584
  const emptySymbols = createSymbolTable();
42589
42585
  const arrayVariances = [1 /* Covariant */];
42590
42586
  const compilerOptions = host.getCompilerOptions();
@@ -43016,7 +43012,9 @@ function createTypeChecker(host) {
43016
43012
  toMarkSkip = toMarkSkip.parent;
43017
43013
  } while (toMarkSkip && toMarkSkip !== containingCall);
43018
43014
  }
43015
+ isInferencePartiallyBlocked = true;
43019
43016
  const result = runWithoutResolvedSignatureCaching(node, fn);
43017
+ isInferencePartiallyBlocked = false;
43020
43018
  if (containingCall) {
43021
43019
  let toMarkSkip = node;
43022
43020
  do {
@@ -53062,6 +53060,7 @@ function createTypeChecker(host) {
53062
53060
  const typeParameter = getTypeParameterFromMappedType(type);
53063
53061
  const constraintType = getConstraintTypeFromMappedType(type);
53064
53062
  const nameType = getNameTypeFromMappedType(type.target || type);
53063
+ const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
53065
53064
  const templateType = getTemplateTypeFromMappedType(type.target || type);
53066
53065
  const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
53067
53066
  const templateModifiers = getMappedTypeModifiers(type);
@@ -53099,7 +53098,7 @@ function createTypeChecker(host) {
53099
53098
  prop.links.keyType = keyType;
53100
53099
  if (modifiersProp) {
53101
53100
  prop.links.syntheticOrigin = modifiersProp;
53102
- prop.declarations = nameType ? void 0 : modifiersProp.declarations;
53101
+ prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
53103
53102
  }
53104
53103
  members.set(propName, prop);
53105
53104
  }
@@ -61834,17 +61833,6 @@ function createTypeChecker(host) {
61834
61833
  function getBaseTypeOfLiteralTypeForComparison(type) {
61835
61834
  return type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & (256 /* NumberLiteral */ | 32 /* Enum */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getBaseTypeOfLiteralTypeForComparison) : type;
61836
61835
  }
61837
- function getValueOfResult(type) {
61838
- const valueOf = getPropertyOfType(type, "valueOf");
61839
- if (valueOf) {
61840
- const signatures = getSignaturesOfType(getTypeOfSymbol(valueOf), 0 /* Call */);
61841
- if (signatures && signatures.length > 0) {
61842
- const returnType = getReturnTypeOfSignature(signatures[0]);
61843
- return returnType;
61844
- }
61845
- }
61846
- return type;
61847
- }
61848
61836
  function getWidenedLiteralType(type) {
61849
61837
  return type.flags & 1056 /* EnumLike */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLikeType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type;
61850
61838
  }
@@ -69669,7 +69657,7 @@ function createTypeChecker(host) {
69669
69657
  const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
69670
69658
  const isDecorator2 = node.kind === 167 /* Decorator */;
69671
69659
  const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
69672
- const reportErrors2 = !candidatesOutArray;
69660
+ const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray;
69673
69661
  let typeArguments;
69674
69662
  if (!isDecorator2 && !isSuperCall(node)) {
69675
69663
  typeArguments = node.typeArguments;
@@ -72916,17 +72904,9 @@ function createTypeChecker(host) {
72916
72904
  if (isTypeAny(left2) || isTypeAny(right2)) {
72917
72905
  return true;
72918
72906
  }
72919
- if (!(left2.flags & 134348796 /* Primitive */))
72920
- left2 = getValueOfResult(left2);
72921
- if (!(right2.flags & 134348796 /* Primitive */))
72922
- right2 = getValueOfResult(right2);
72923
72907
  const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType);
72924
- if (leftAssignableToNumber) {
72925
- const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
72926
- if (rightAssignableToNumber)
72927
- return true;
72928
- }
72929
- return isTypeAssignableTo(left2, stringType) && isTypeAssignableTo(right2, stringType);
72908
+ const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
72909
+ return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2);
72930
72910
  });
72931
72911
  }
72932
72912
  return booleanType;
@@ -74755,6 +74735,17 @@ function createTypeChecker(host) {
74755
74735
  lastSeenNonAmbientDeclaration = node;
74756
74736
  }
74757
74737
  }
74738
+ if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
74739
+ for (const node2 of current.jsDoc) {
74740
+ if (node2.tags) {
74741
+ for (const tag of node2.tags) {
74742
+ if (isJSDocOverloadTag(tag)) {
74743
+ hasOverloads = true;
74744
+ }
74745
+ }
74746
+ }
74747
+ }
74748
+ }
74758
74749
  }
74759
74750
  }
74760
74751
  if (multipleConstructorImplementation) {
@@ -74792,8 +74783,9 @@ function createTypeChecker(host) {
74792
74783
  const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
74793
74784
  for (const signature of signatures) {
74794
74785
  if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
74786
+ const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
74795
74787
  addRelatedInfo(
74796
- error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
74788
+ error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
74797
74789
  createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
74798
74790
  );
74799
74791
  break;
@@ -81409,7 +81401,6 @@ function createTypeChecker(host) {
81409
81401
  case 299 /* PropertyAssignment */:
81410
81402
  case 300 /* ShorthandPropertyAssignment */:
81411
81403
  case 267 /* NamespaceExportDeclaration */:
81412
- case 181 /* FunctionType */:
81413
81404
  case 279 /* MissingDeclaration */:
81414
81405
  return find(node.modifiers, isModifier);
81415
81406
  default:
package/lib/tsserver.js CHANGED
@@ -1351,6 +1351,7 @@ __export(server_exports, {
1351
1351
  isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
1352
1352
  isGlobalDeclaration: () => isGlobalDeclaration,
1353
1353
  isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
1354
+ isGrammarError: () => isGrammarError,
1354
1355
  isHeritageClause: () => isHeritageClause,
1355
1356
  isHoistedFunction: () => isHoistedFunction,
1356
1357
  isHoistedVariableStatement: () => isHoistedVariableStatement,
@@ -2287,7 +2288,7 @@ module.exports = __toCommonJS(server_exports);
2287
2288
 
2288
2289
  // src/compiler/corePublic.ts
2289
2290
  var versionMajorMinor = "5.0";
2290
- var version = `${versionMajorMinor}.0-insiders.20230216`;
2291
+ var version = `${versionMajorMinor}.0-insiders.20230217`;
2291
2292
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2292
2293
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2293
2294
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -15193,6 +15194,36 @@ function nodeIsMissing(node) {
15193
15194
  function nodeIsPresent(node) {
15194
15195
  return !nodeIsMissing(node);
15195
15196
  }
15197
+ function isGrammarError(parent2, child) {
15198
+ if (isTypeParameterDeclaration(parent2))
15199
+ return child === parent2.expression;
15200
+ if (isClassStaticBlockDeclaration(parent2))
15201
+ return child === parent2.modifiers;
15202
+ if (isPropertySignature(parent2))
15203
+ return child === parent2.initializer;
15204
+ if (isPropertyDeclaration(parent2))
15205
+ return child === parent2.questionToken && isAutoAccessorPropertyDeclaration(parent2);
15206
+ if (isPropertyAssignment(parent2))
15207
+ return child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
15208
+ if (isShorthandPropertyAssignment(parent2))
15209
+ return child === parent2.equalsToken || child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
15210
+ if (isMethodDeclaration(parent2))
15211
+ return child === parent2.exclamationToken;
15212
+ if (isConstructorDeclaration(parent2))
15213
+ return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
15214
+ if (isGetAccessorDeclaration(parent2))
15215
+ return child === parent2.typeParameters || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
15216
+ if (isSetAccessorDeclaration(parent2))
15217
+ return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
15218
+ if (isNamespaceExportDeclaration(parent2))
15219
+ return child === parent2.modifiers || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
15220
+ return false;
15221
+ }
15222
+ function isGrammarErrorElement(nodeArray, child, isElement) {
15223
+ if (!nodeArray || isArray(child) || !isElement(child))
15224
+ return false;
15225
+ return contains(nodeArray, child);
15226
+ }
15196
15227
  function insertStatementsAfterPrologue(to, from, isPrologueDirective2) {
15197
15228
  if (from === void 0 || from.length === 0)
15198
15229
  return to;
@@ -29280,7 +29311,7 @@ function canHaveIllegalDecorators(node) {
29280
29311
  }
29281
29312
  function canHaveIllegalModifiers(node) {
29282
29313
  const kind = node.kind;
29283
- return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */;
29314
+ return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */;
29284
29315
  }
29285
29316
  function isQuestionOrExclamationToken(node) {
29286
29317
  return isQuestionToken(node) || isExclamationToken(node);
@@ -32595,6 +32626,7 @@ var Parser;
32595
32626
  const hasJSDoc = hasPrecedingJSDocComment();
32596
32627
  const modifiers = parseModifiersForConstructorType();
32597
32628
  const isConstructorType = parseOptional(103 /* NewKeyword */);
32629
+ Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");
32598
32630
  const typeParameters = parseTypeParameters();
32599
32631
  const parameters = parseParameters(4 /* Type */);
32600
32632
  const type = parseReturnType(
@@ -32603,8 +32635,6 @@ var Parser;
32603
32635
  false
32604
32636
  );
32605
32637
  const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
32606
- if (!isConstructorType)
32607
- node.modifiers = modifiers;
32608
32638
  return withJSDoc(finishNode(node, pos), hasJSDoc);
32609
32639
  }
32610
32640
  function parseKeywordAndNoDot() {
@@ -33901,13 +33931,9 @@ var Parser;
33901
33931
  function parseJsxClosingFragment(inExpressionContext) {
33902
33932
  const pos = getNodePos();
33903
33933
  parseExpected(30 /* LessThanSlashToken */);
33904
- if (tokenIsIdentifierOrKeyword(token())) {
33905
- parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
33906
- }
33907
33934
  if (parseExpected(
33908
33935
  31 /* GreaterThanToken */,
33909
- /*diagnostic*/
33910
- void 0,
33936
+ Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment,
33911
33937
  /*shouldAdvance*/
33912
33938
  false
33913
33939
  )) {
@@ -47161,6 +47187,7 @@ function createTypeChecker(host) {
47161
47187
  let inlineLevel = 0;
47162
47188
  let currentNode;
47163
47189
  let varianceTypeParameter;
47190
+ let isInferencePartiallyBlocked = false;
47164
47191
  const emptySymbols = createSymbolTable();
47165
47192
  const arrayVariances = [1 /* Covariant */];
47166
47193
  const compilerOptions = host.getCompilerOptions();
@@ -47592,7 +47619,9 @@ function createTypeChecker(host) {
47592
47619
  toMarkSkip = toMarkSkip.parent;
47593
47620
  } while (toMarkSkip && toMarkSkip !== containingCall);
47594
47621
  }
47622
+ isInferencePartiallyBlocked = true;
47595
47623
  const result = runWithoutResolvedSignatureCaching(node, fn);
47624
+ isInferencePartiallyBlocked = false;
47596
47625
  if (containingCall) {
47597
47626
  let toMarkSkip = node;
47598
47627
  do {
@@ -57638,6 +57667,7 @@ function createTypeChecker(host) {
57638
57667
  const typeParameter = getTypeParameterFromMappedType(type);
57639
57668
  const constraintType = getConstraintTypeFromMappedType(type);
57640
57669
  const nameType = getNameTypeFromMappedType(type.target || type);
57670
+ const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
57641
57671
  const templateType = getTemplateTypeFromMappedType(type.target || type);
57642
57672
  const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
57643
57673
  const templateModifiers = getMappedTypeModifiers(type);
@@ -57675,7 +57705,7 @@ function createTypeChecker(host) {
57675
57705
  prop.links.keyType = keyType;
57676
57706
  if (modifiersProp) {
57677
57707
  prop.links.syntheticOrigin = modifiersProp;
57678
- prop.declarations = nameType ? void 0 : modifiersProp.declarations;
57708
+ prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
57679
57709
  }
57680
57710
  members.set(propName, prop);
57681
57711
  }
@@ -66410,17 +66440,6 @@ function createTypeChecker(host) {
66410
66440
  function getBaseTypeOfLiteralTypeForComparison(type) {
66411
66441
  return type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & (256 /* NumberLiteral */ | 32 /* Enum */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getBaseTypeOfLiteralTypeForComparison) : type;
66412
66442
  }
66413
- function getValueOfResult(type) {
66414
- const valueOf = getPropertyOfType(type, "valueOf");
66415
- if (valueOf) {
66416
- const signatures = getSignaturesOfType(getTypeOfSymbol(valueOf), 0 /* Call */);
66417
- if (signatures && signatures.length > 0) {
66418
- const returnType = getReturnTypeOfSignature(signatures[0]);
66419
- return returnType;
66420
- }
66421
- }
66422
- return type;
66423
- }
66424
66443
  function getWidenedLiteralType(type) {
66425
66444
  return type.flags & 1056 /* EnumLike */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLikeType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type;
66426
66445
  }
@@ -74245,7 +74264,7 @@ function createTypeChecker(host) {
74245
74264
  const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
74246
74265
  const isDecorator2 = node.kind === 167 /* Decorator */;
74247
74266
  const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
74248
- const reportErrors2 = !candidatesOutArray;
74267
+ const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray;
74249
74268
  let typeArguments;
74250
74269
  if (!isDecorator2 && !isSuperCall(node)) {
74251
74270
  typeArguments = node.typeArguments;
@@ -77492,17 +77511,9 @@ function createTypeChecker(host) {
77492
77511
  if (isTypeAny(left2) || isTypeAny(right2)) {
77493
77512
  return true;
77494
77513
  }
77495
- if (!(left2.flags & 134348796 /* Primitive */))
77496
- left2 = getValueOfResult(left2);
77497
- if (!(right2.flags & 134348796 /* Primitive */))
77498
- right2 = getValueOfResult(right2);
77499
77514
  const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType);
77500
- if (leftAssignableToNumber) {
77501
- const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
77502
- if (rightAssignableToNumber)
77503
- return true;
77504
- }
77505
- return isTypeAssignableTo(left2, stringType) && isTypeAssignableTo(right2, stringType);
77515
+ const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
77516
+ return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2);
77506
77517
  });
77507
77518
  }
77508
77519
  return booleanType;
@@ -79331,6 +79342,17 @@ function createTypeChecker(host) {
79331
79342
  lastSeenNonAmbientDeclaration = node;
79332
79343
  }
79333
79344
  }
79345
+ if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
79346
+ for (const node2 of current.jsDoc) {
79347
+ if (node2.tags) {
79348
+ for (const tag of node2.tags) {
79349
+ if (isJSDocOverloadTag(tag)) {
79350
+ hasOverloads = true;
79351
+ }
79352
+ }
79353
+ }
79354
+ }
79355
+ }
79334
79356
  }
79335
79357
  }
79336
79358
  if (multipleConstructorImplementation) {
@@ -79368,8 +79390,9 @@ function createTypeChecker(host) {
79368
79390
  const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
79369
79391
  for (const signature of signatures) {
79370
79392
  if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
79393
+ const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
79371
79394
  addRelatedInfo(
79372
- error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
79395
+ error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
79373
79396
  createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
79374
79397
  );
79375
79398
  break;
@@ -85985,7 +86008,6 @@ function createTypeChecker(host) {
85985
86008
  case 299 /* PropertyAssignment */:
85986
86009
  case 300 /* ShorthandPropertyAssignment */:
85987
86010
  case 267 /* NamespaceExportDeclaration */:
85988
- case 181 /* FunctionType */:
85989
86011
  case 279 /* MissingDeclaration */:
85990
86012
  return find(node.modifiers, isModifier);
85991
86013
  default:
@@ -147268,7 +147290,14 @@ function updatePropertyDeclaration(changeTracker, file, declaration, type, field
147268
147290
  changeTracker.replaceNode(file, declaration, property);
147269
147291
  }
147270
147292
  function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) {
147271
- const assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer);
147293
+ let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer);
147294
+ if (assignment.modifiers || assignment.questionToken || assignment.exclamationToken) {
147295
+ if (assignment === declaration)
147296
+ assignment = factory.cloneNode(assignment);
147297
+ assignment.modifiers = void 0;
147298
+ assignment.questionToken = void 0;
147299
+ assignment.exclamationToken = void 0;
147300
+ }
147272
147301
  changeTracker.replacePropertyAssignment(file, declaration, assignment);
147273
147302
  }
147274
147303
  function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {
@@ -166467,7 +166496,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
166467
166496
  }
166468
166497
  if (isToken(child)) {
166469
166498
  const tokenInfo = formattingScanner.readTokenInfo(child);
166470
- if (child.kind !== 11 /* JsxText */) {
166499
+ if (child.kind !== 11 /* JsxText */ && !isGrammarError(parent2, child)) {
166471
166500
  Debug.assert(tokenInfo.token.end === child.end, "Token end is child end");
166472
166501
  consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);
166473
166502
  return inheritedIndentation;
@@ -168837,6 +168866,7 @@ __export(ts_exports3, {
168837
168866
  isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
168838
168867
  isGlobalDeclaration: () => isGlobalDeclaration,
168839
168868
  isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
168869
+ isGrammarError: () => isGrammarError,
168840
168870
  isHeritageClause: () => isHeritageClause,
168841
168871
  isHoistedFunction: () => isHoistedFunction,
168842
168872
  isHoistedVariableStatement: () => isHoistedVariableStatement,
@@ -182786,6 +182816,7 @@ start(initializeNodeSystem(), require("os").platform());
182786
182816
  isGetOrSetAccessorDeclaration,
182787
182817
  isGlobalDeclaration,
182788
182818
  isGlobalScopeAugmentation,
182819
+ isGrammarError,
182789
182820
  isHeritageClause,
182790
182821
  isHoistedFunction,
182791
182822
  isHoistedVariableStatement,
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.0";
38
- version = `${versionMajorMinor}.0-insiders.20230216`;
38
+ version = `${versionMajorMinor}.0-insiders.20230217`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -13027,6 +13027,36 @@ ${lanes.join("\n")}
13027
13027
  function nodeIsPresent(node) {
13028
13028
  return !nodeIsMissing(node);
13029
13029
  }
13030
+ function isGrammarError(parent2, child) {
13031
+ if (isTypeParameterDeclaration(parent2))
13032
+ return child === parent2.expression;
13033
+ if (isClassStaticBlockDeclaration(parent2))
13034
+ return child === parent2.modifiers;
13035
+ if (isPropertySignature(parent2))
13036
+ return child === parent2.initializer;
13037
+ if (isPropertyDeclaration(parent2))
13038
+ return child === parent2.questionToken && isAutoAccessorPropertyDeclaration(parent2);
13039
+ if (isPropertyAssignment(parent2))
13040
+ return child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
13041
+ if (isShorthandPropertyAssignment(parent2))
13042
+ return child === parent2.equalsToken || child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
13043
+ if (isMethodDeclaration(parent2))
13044
+ return child === parent2.exclamationToken;
13045
+ if (isConstructorDeclaration(parent2))
13046
+ return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
13047
+ if (isGetAccessorDeclaration(parent2))
13048
+ return child === parent2.typeParameters || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
13049
+ if (isSetAccessorDeclaration(parent2))
13050
+ return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
13051
+ if (isNamespaceExportDeclaration(parent2))
13052
+ return child === parent2.modifiers || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
13053
+ return false;
13054
+ }
13055
+ function isGrammarErrorElement(nodeArray, child, isElement) {
13056
+ if (!nodeArray || isArray(child) || !isElement(child))
13057
+ return false;
13058
+ return contains(nodeArray, child);
13059
+ }
13030
13060
  function insertStatementsAfterPrologue(to, from, isPrologueDirective2) {
13031
13061
  if (from === void 0 || from.length === 0)
13032
13062
  return to;
@@ -27168,7 +27198,7 @@ ${lanes.join("\n")}
27168
27198
  }
27169
27199
  function canHaveIllegalModifiers(node) {
27170
27200
  const kind = node.kind;
27171
- return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */;
27201
+ return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */;
27172
27202
  }
27173
27203
  function isQuestionOrExclamationToken(node) {
27174
27204
  return isQuestionToken(node) || isExclamationToken(node);
@@ -30706,6 +30736,7 @@ ${lanes.join("\n")}
30706
30736
  const hasJSDoc = hasPrecedingJSDocComment();
30707
30737
  const modifiers = parseModifiersForConstructorType();
30708
30738
  const isConstructorType = parseOptional(103 /* NewKeyword */);
30739
+ Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");
30709
30740
  const typeParameters = parseTypeParameters();
30710
30741
  const parameters = parseParameters(4 /* Type */);
30711
30742
  const type = parseReturnType(
@@ -30714,8 +30745,6 @@ ${lanes.join("\n")}
30714
30745
  false
30715
30746
  );
30716
30747
  const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
30717
- if (!isConstructorType)
30718
- node.modifiers = modifiers;
30719
30748
  return withJSDoc(finishNode(node, pos), hasJSDoc);
30720
30749
  }
30721
30750
  function parseKeywordAndNoDot() {
@@ -32012,13 +32041,9 @@ ${lanes.join("\n")}
32012
32041
  function parseJsxClosingFragment(inExpressionContext) {
32013
32042
  const pos = getNodePos();
32014
32043
  parseExpected(30 /* LessThanSlashToken */);
32015
- if (tokenIsIdentifierOrKeyword(token())) {
32016
- parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
32017
- }
32018
32044
  if (parseExpected(
32019
32045
  31 /* GreaterThanToken */,
32020
- /*diagnostic*/
32021
- void 0,
32046
+ Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment,
32022
32047
  /*shouldAdvance*/
32023
32048
  false
32024
32049
  )) {
@@ -44970,6 +44995,7 @@ ${lanes.join("\n")}
44970
44995
  let inlineLevel = 0;
44971
44996
  let currentNode;
44972
44997
  let varianceTypeParameter;
44998
+ let isInferencePartiallyBlocked = false;
44973
44999
  const emptySymbols = createSymbolTable();
44974
45000
  const arrayVariances = [1 /* Covariant */];
44975
45001
  const compilerOptions = host.getCompilerOptions();
@@ -45401,7 +45427,9 @@ ${lanes.join("\n")}
45401
45427
  toMarkSkip = toMarkSkip.parent;
45402
45428
  } while (toMarkSkip && toMarkSkip !== containingCall);
45403
45429
  }
45430
+ isInferencePartiallyBlocked = true;
45404
45431
  const result = runWithoutResolvedSignatureCaching(node, fn);
45432
+ isInferencePartiallyBlocked = false;
45405
45433
  if (containingCall) {
45406
45434
  let toMarkSkip = node;
45407
45435
  do {
@@ -55447,6 +55475,7 @@ ${lanes.join("\n")}
55447
55475
  const typeParameter = getTypeParameterFromMappedType(type);
55448
55476
  const constraintType = getConstraintTypeFromMappedType(type);
55449
55477
  const nameType = getNameTypeFromMappedType(type.target || type);
55478
+ const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
55450
55479
  const templateType = getTemplateTypeFromMappedType(type.target || type);
55451
55480
  const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
55452
55481
  const templateModifiers = getMappedTypeModifiers(type);
@@ -55484,7 +55513,7 @@ ${lanes.join("\n")}
55484
55513
  prop.links.keyType = keyType;
55485
55514
  if (modifiersProp) {
55486
55515
  prop.links.syntheticOrigin = modifiersProp;
55487
- prop.declarations = nameType ? void 0 : modifiersProp.declarations;
55516
+ prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
55488
55517
  }
55489
55518
  members.set(propName, prop);
55490
55519
  }
@@ -64219,17 +64248,6 @@ ${lanes.join("\n")}
64219
64248
  function getBaseTypeOfLiteralTypeForComparison(type) {
64220
64249
  return type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & (256 /* NumberLiteral */ | 32 /* Enum */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getBaseTypeOfLiteralTypeForComparison) : type;
64221
64250
  }
64222
- function getValueOfResult(type) {
64223
- const valueOf = getPropertyOfType(type, "valueOf");
64224
- if (valueOf) {
64225
- const signatures = getSignaturesOfType(getTypeOfSymbol(valueOf), 0 /* Call */);
64226
- if (signatures && signatures.length > 0) {
64227
- const returnType = getReturnTypeOfSignature(signatures[0]);
64228
- return returnType;
64229
- }
64230
- }
64231
- return type;
64232
- }
64233
64251
  function getWidenedLiteralType(type) {
64234
64252
  return type.flags & 1056 /* EnumLike */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLikeType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type;
64235
64253
  }
@@ -72054,7 +72072,7 @@ ${lanes.join("\n")}
72054
72072
  const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
72055
72073
  const isDecorator2 = node.kind === 167 /* Decorator */;
72056
72074
  const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
72057
- const reportErrors2 = !candidatesOutArray;
72075
+ const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray;
72058
72076
  let typeArguments;
72059
72077
  if (!isDecorator2 && !isSuperCall(node)) {
72060
72078
  typeArguments = node.typeArguments;
@@ -75301,17 +75319,9 @@ ${lanes.join("\n")}
75301
75319
  if (isTypeAny(left2) || isTypeAny(right2)) {
75302
75320
  return true;
75303
75321
  }
75304
- if (!(left2.flags & 134348796 /* Primitive */))
75305
- left2 = getValueOfResult(left2);
75306
- if (!(right2.flags & 134348796 /* Primitive */))
75307
- right2 = getValueOfResult(right2);
75308
75322
  const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType);
75309
- if (leftAssignableToNumber) {
75310
- const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
75311
- if (rightAssignableToNumber)
75312
- return true;
75313
- }
75314
- return isTypeAssignableTo(left2, stringType) && isTypeAssignableTo(right2, stringType);
75323
+ const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
75324
+ return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2);
75315
75325
  });
75316
75326
  }
75317
75327
  return booleanType;
@@ -77140,6 +77150,17 @@ ${lanes.join("\n")}
77140
77150
  lastSeenNonAmbientDeclaration = node;
77141
77151
  }
77142
77152
  }
77153
+ if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
77154
+ for (const node2 of current.jsDoc) {
77155
+ if (node2.tags) {
77156
+ for (const tag of node2.tags) {
77157
+ if (isJSDocOverloadTag(tag)) {
77158
+ hasOverloads = true;
77159
+ }
77160
+ }
77161
+ }
77162
+ }
77163
+ }
77143
77164
  }
77144
77165
  }
77145
77166
  if (multipleConstructorImplementation) {
@@ -77177,8 +77198,9 @@ ${lanes.join("\n")}
77177
77198
  const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
77178
77199
  for (const signature of signatures) {
77179
77200
  if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
77201
+ const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
77180
77202
  addRelatedInfo(
77181
- error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
77203
+ error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
77182
77204
  createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
77183
77205
  );
77184
77206
  break;
@@ -83794,7 +83816,6 @@ ${lanes.join("\n")}
83794
83816
  case 299 /* PropertyAssignment */:
83795
83817
  case 300 /* ShorthandPropertyAssignment */:
83796
83818
  case 267 /* NamespaceExportDeclaration */:
83797
- case 181 /* FunctionType */:
83798
83819
  case 279 /* MissingDeclaration */:
83799
83820
  return find(node.modifiers, isModifier);
83800
83821
  default:
@@ -146152,7 +146173,14 @@ ${lanes.join("\n")}
146152
146173
  changeTracker.replaceNode(file, declaration, property);
146153
146174
  }
146154
146175
  function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) {
146155
- const assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer);
146176
+ let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer);
146177
+ if (assignment.modifiers || assignment.questionToken || assignment.exclamationToken) {
146178
+ if (assignment === declaration)
146179
+ assignment = factory.cloneNode(assignment);
146180
+ assignment.modifiers = void 0;
146181
+ assignment.questionToken = void 0;
146182
+ assignment.exclamationToken = void 0;
146183
+ }
146156
146184
  changeTracker.replacePropertyAssignment(file, declaration, assignment);
146157
146185
  }
146158
146186
  function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {
@@ -165958,7 +165986,7 @@ ${options.prefix}` : "\n" : options.prefix
165958
165986
  }
165959
165987
  if (isToken(child)) {
165960
165988
  const tokenInfo = formattingScanner.readTokenInfo(child);
165961
- if (child.kind !== 11 /* JsxText */) {
165989
+ if (child.kind !== 11 /* JsxText */ && !isGrammarError(parent2, child)) {
165962
165990
  Debug.assert(tokenInfo.token.end === child.end, "Token end is child end");
165963
165991
  consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);
165964
165992
  return inheritedIndentation;
@@ -179424,6 +179452,7 @@ ${e.message}`;
179424
179452
  isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
179425
179453
  isGlobalDeclaration: () => isGlobalDeclaration,
179426
179454
  isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
179455
+ isGrammarError: () => isGrammarError,
179427
179456
  isHeritageClause: () => isHeritageClause,
179428
179457
  isHoistedFunction: () => isHoistedFunction,
179429
179458
  isHoistedVariableStatement: () => isHoistedVariableStatement,
@@ -181783,6 +181812,7 @@ ${e.message}`;
181783
181812
  isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
181784
181813
  isGlobalDeclaration: () => isGlobalDeclaration,
181785
181814
  isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
181815
+ isGrammarError: () => isGrammarError,
181786
181816
  isHeritageClause: () => isHeritageClause,
181787
181817
  isHoistedFunction: () => isHoistedFunction,
181788
181818
  isHoistedVariableStatement: () => isHoistedVariableStatement,
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.0";
38
- version = `${versionMajorMinor}.0-insiders.20230216`;
38
+ version = `${versionMajorMinor}.0-insiders.20230217`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -13027,6 +13027,36 @@ ${lanes.join("\n")}
13027
13027
  function nodeIsPresent(node) {
13028
13028
  return !nodeIsMissing(node);
13029
13029
  }
13030
+ function isGrammarError(parent2, child) {
13031
+ if (isTypeParameterDeclaration(parent2))
13032
+ return child === parent2.expression;
13033
+ if (isClassStaticBlockDeclaration(parent2))
13034
+ return child === parent2.modifiers;
13035
+ if (isPropertySignature(parent2))
13036
+ return child === parent2.initializer;
13037
+ if (isPropertyDeclaration(parent2))
13038
+ return child === parent2.questionToken && isAutoAccessorPropertyDeclaration(parent2);
13039
+ if (isPropertyAssignment(parent2))
13040
+ return child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
13041
+ if (isShorthandPropertyAssignment(parent2))
13042
+ return child === parent2.equalsToken || child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
13043
+ if (isMethodDeclaration(parent2))
13044
+ return child === parent2.exclamationToken;
13045
+ if (isConstructorDeclaration(parent2))
13046
+ return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
13047
+ if (isGetAccessorDeclaration(parent2))
13048
+ return child === parent2.typeParameters || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
13049
+ if (isSetAccessorDeclaration(parent2))
13050
+ return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
13051
+ if (isNamespaceExportDeclaration(parent2))
13052
+ return child === parent2.modifiers || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
13053
+ return false;
13054
+ }
13055
+ function isGrammarErrorElement(nodeArray, child, isElement) {
13056
+ if (!nodeArray || isArray(child) || !isElement(child))
13057
+ return false;
13058
+ return contains(nodeArray, child);
13059
+ }
13030
13060
  function insertStatementsAfterPrologue(to, from, isPrologueDirective2) {
13031
13061
  if (from === void 0 || from.length === 0)
13032
13062
  return to;
@@ -27168,7 +27198,7 @@ ${lanes.join("\n")}
27168
27198
  }
27169
27199
  function canHaveIllegalModifiers(node) {
27170
27200
  const kind = node.kind;
27171
- return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 181 /* FunctionType */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */;
27201
+ return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */;
27172
27202
  }
27173
27203
  function isQuestionOrExclamationToken(node) {
27174
27204
  return isQuestionToken(node) || isExclamationToken(node);
@@ -30706,6 +30736,7 @@ ${lanes.join("\n")}
30706
30736
  const hasJSDoc = hasPrecedingJSDocComment();
30707
30737
  const modifiers = parseModifiersForConstructorType();
30708
30738
  const isConstructorType = parseOptional(103 /* NewKeyword */);
30739
+ Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");
30709
30740
  const typeParameters = parseTypeParameters();
30710
30741
  const parameters = parseParameters(4 /* Type */);
30711
30742
  const type = parseReturnType(
@@ -30714,8 +30745,6 @@ ${lanes.join("\n")}
30714
30745
  false
30715
30746
  );
30716
30747
  const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
30717
- if (!isConstructorType)
30718
- node.modifiers = modifiers;
30719
30748
  return withJSDoc(finishNode(node, pos), hasJSDoc);
30720
30749
  }
30721
30750
  function parseKeywordAndNoDot() {
@@ -32012,13 +32041,9 @@ ${lanes.join("\n")}
32012
32041
  function parseJsxClosingFragment(inExpressionContext) {
32013
32042
  const pos = getNodePos();
32014
32043
  parseExpected(30 /* LessThanSlashToken */);
32015
- if (tokenIsIdentifierOrKeyword(token())) {
32016
- parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
32017
- }
32018
32044
  if (parseExpected(
32019
32045
  31 /* GreaterThanToken */,
32020
- /*diagnostic*/
32021
- void 0,
32046
+ Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment,
32022
32047
  /*shouldAdvance*/
32023
32048
  false
32024
32049
  )) {
@@ -44970,6 +44995,7 @@ ${lanes.join("\n")}
44970
44995
  let inlineLevel = 0;
44971
44996
  let currentNode;
44972
44997
  let varianceTypeParameter;
44998
+ let isInferencePartiallyBlocked = false;
44973
44999
  const emptySymbols = createSymbolTable();
44974
45000
  const arrayVariances = [1 /* Covariant */];
44975
45001
  const compilerOptions = host.getCompilerOptions();
@@ -45401,7 +45427,9 @@ ${lanes.join("\n")}
45401
45427
  toMarkSkip = toMarkSkip.parent;
45402
45428
  } while (toMarkSkip && toMarkSkip !== containingCall);
45403
45429
  }
45430
+ isInferencePartiallyBlocked = true;
45404
45431
  const result = runWithoutResolvedSignatureCaching(node, fn);
45432
+ isInferencePartiallyBlocked = false;
45405
45433
  if (containingCall) {
45406
45434
  let toMarkSkip = node;
45407
45435
  do {
@@ -55447,6 +55475,7 @@ ${lanes.join("\n")}
55447
55475
  const typeParameter = getTypeParameterFromMappedType(type);
55448
55476
  const constraintType = getConstraintTypeFromMappedType(type);
55449
55477
  const nameType = getNameTypeFromMappedType(type.target || type);
55478
+ const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
55450
55479
  const templateType = getTemplateTypeFromMappedType(type.target || type);
55451
55480
  const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
55452
55481
  const templateModifiers = getMappedTypeModifiers(type);
@@ -55484,7 +55513,7 @@ ${lanes.join("\n")}
55484
55513
  prop.links.keyType = keyType;
55485
55514
  if (modifiersProp) {
55486
55515
  prop.links.syntheticOrigin = modifiersProp;
55487
- prop.declarations = nameType ? void 0 : modifiersProp.declarations;
55516
+ prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
55488
55517
  }
55489
55518
  members.set(propName, prop);
55490
55519
  }
@@ -64219,17 +64248,6 @@ ${lanes.join("\n")}
64219
64248
  function getBaseTypeOfLiteralTypeForComparison(type) {
64220
64249
  return type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & (256 /* NumberLiteral */ | 32 /* Enum */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getBaseTypeOfLiteralTypeForComparison) : type;
64221
64250
  }
64222
- function getValueOfResult(type) {
64223
- const valueOf = getPropertyOfType(type, "valueOf");
64224
- if (valueOf) {
64225
- const signatures = getSignaturesOfType(getTypeOfSymbol(valueOf), 0 /* Call */);
64226
- if (signatures && signatures.length > 0) {
64227
- const returnType = getReturnTypeOfSignature(signatures[0]);
64228
- return returnType;
64229
- }
64230
- }
64231
- return type;
64232
- }
64233
64251
  function getWidenedLiteralType(type) {
64234
64252
  return type.flags & 1056 /* EnumLike */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLikeType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type;
64235
64253
  }
@@ -72054,7 +72072,7 @@ ${lanes.join("\n")}
72054
72072
  const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
72055
72073
  const isDecorator2 = node.kind === 167 /* Decorator */;
72056
72074
  const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
72057
- const reportErrors2 = !candidatesOutArray;
72075
+ const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray;
72058
72076
  let typeArguments;
72059
72077
  if (!isDecorator2 && !isSuperCall(node)) {
72060
72078
  typeArguments = node.typeArguments;
@@ -75301,17 +75319,9 @@ ${lanes.join("\n")}
75301
75319
  if (isTypeAny(left2) || isTypeAny(right2)) {
75302
75320
  return true;
75303
75321
  }
75304
- if (!(left2.flags & 134348796 /* Primitive */))
75305
- left2 = getValueOfResult(left2);
75306
- if (!(right2.flags & 134348796 /* Primitive */))
75307
- right2 = getValueOfResult(right2);
75308
75322
  const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType);
75309
- if (leftAssignableToNumber) {
75310
- const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
75311
- if (rightAssignableToNumber)
75312
- return true;
75313
- }
75314
- return isTypeAssignableTo(left2, stringType) && isTypeAssignableTo(right2, stringType);
75323
+ const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
75324
+ return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2);
75315
75325
  });
75316
75326
  }
75317
75327
  return booleanType;
@@ -77140,6 +77150,17 @@ ${lanes.join("\n")}
77140
77150
  lastSeenNonAmbientDeclaration = node;
77141
77151
  }
77142
77152
  }
77153
+ if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
77154
+ for (const node2 of current.jsDoc) {
77155
+ if (node2.tags) {
77156
+ for (const tag of node2.tags) {
77157
+ if (isJSDocOverloadTag(tag)) {
77158
+ hasOverloads = true;
77159
+ }
77160
+ }
77161
+ }
77162
+ }
77163
+ }
77143
77164
  }
77144
77165
  }
77145
77166
  if (multipleConstructorImplementation) {
@@ -77177,8 +77198,9 @@ ${lanes.join("\n")}
77177
77198
  const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
77178
77199
  for (const signature of signatures) {
77179
77200
  if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
77201
+ const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
77180
77202
  addRelatedInfo(
77181
- error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
77203
+ error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
77182
77204
  createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
77183
77205
  );
77184
77206
  break;
@@ -83794,7 +83816,6 @@ ${lanes.join("\n")}
83794
83816
  case 299 /* PropertyAssignment */:
83795
83817
  case 300 /* ShorthandPropertyAssignment */:
83796
83818
  case 267 /* NamespaceExportDeclaration */:
83797
- case 181 /* FunctionType */:
83798
83819
  case 279 /* MissingDeclaration */:
83799
83820
  return find(node.modifiers, isModifier);
83800
83821
  default:
@@ -146166,7 +146187,14 @@ ${lanes.join("\n")}
146166
146187
  changeTracker.replaceNode(file, declaration, property);
146167
146188
  }
146168
146189
  function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) {
146169
- const assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer);
146190
+ let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer);
146191
+ if (assignment.modifiers || assignment.questionToken || assignment.exclamationToken) {
146192
+ if (assignment === declaration)
146193
+ assignment = factory.cloneNode(assignment);
146194
+ assignment.modifiers = void 0;
146195
+ assignment.questionToken = void 0;
146196
+ assignment.exclamationToken = void 0;
146197
+ }
146170
146198
  changeTracker.replacePropertyAssignment(file, declaration, assignment);
146171
146199
  }
146172
146200
  function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {
@@ -165972,7 +166000,7 @@ ${options.prefix}` : "\n" : options.prefix
165972
166000
  }
165973
166001
  if (isToken(child)) {
165974
166002
  const tokenInfo = formattingScanner.readTokenInfo(child);
165975
- if (child.kind !== 11 /* JsxText */) {
166003
+ if (child.kind !== 11 /* JsxText */ && !isGrammarError(parent2, child)) {
165976
166004
  Debug.assert(tokenInfo.token.end === child.end, "Token end is child end");
165977
166005
  consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);
165978
166006
  return inheritedIndentation;
@@ -168605,6 +168633,7 @@ ${options.prefix}` : "\n" : options.prefix
168605
168633
  isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
168606
168634
  isGlobalDeclaration: () => isGlobalDeclaration,
168607
168635
  isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
168636
+ isGrammarError: () => isGrammarError,
168608
168637
  isHeritageClause: () => isHeritageClause,
168609
168638
  isHoistedFunction: () => isHoistedFunction,
168610
168639
  isHoistedVariableStatement: () => isHoistedVariableStatement,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.0";
57
- var version = `${versionMajorMinor}.0-insiders.20230216`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230217`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -21124,6 +21124,7 @@ var Parser;
21124
21124
  const hasJSDoc = hasPrecedingJSDocComment();
21125
21125
  const modifiers = parseModifiersForConstructorType();
21126
21126
  const isConstructorType = parseOptional(103 /* NewKeyword */);
21127
+ Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");
21127
21128
  const typeParameters = parseTypeParameters();
21128
21129
  const parameters = parseParameters(4 /* Type */);
21129
21130
  const type = parseReturnType(
@@ -21132,8 +21133,6 @@ var Parser;
21132
21133
  false
21133
21134
  );
21134
21135
  const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
21135
- if (!isConstructorType)
21136
- node.modifiers = modifiers;
21137
21136
  return withJSDoc(finishNode(node, pos), hasJSDoc);
21138
21137
  }
21139
21138
  function parseKeywordAndNoDot() {
@@ -22430,13 +22429,9 @@ var Parser;
22430
22429
  function parseJsxClosingFragment(inExpressionContext) {
22431
22430
  const pos = getNodePos();
22432
22431
  parseExpected(30 /* LessThanSlashToken */);
22433
- if (tokenIsIdentifierOrKeyword(token())) {
22434
- parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
22435
- }
22436
22432
  if (parseExpected(
22437
22433
  31 /* GreaterThanToken */,
22438
- /*diagnostic*/
22439
- void 0,
22434
+ Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment,
22440
22435
  /*shouldAdvance*/
22441
22436
  false
22442
22437
  )) {
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.0.0-pr-52807-23",
5
+ "version": "5.0.0-pr-52818-5",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [