@typescript-deploys/pr-build 5.0.0-pr-49627-28 → 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 {
@@ -47824,7 +47822,7 @@ function createTypeChecker(host) {
47824
47822
  );
47825
47823
  }
47826
47824
  function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
47827
- var _a2, _b, _c, _d, _e;
47825
+ var _a2, _b, _c, _d;
47828
47826
  const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
47829
47827
  if (suppressAny)
47830
47828
  context.flags &= ~256 /* SuppressAnyReturnType */;
@@ -47841,29 +47839,6 @@ function createTypeChecker(host) {
47841
47839
  /*skipUnionExpanding*/
47842
47840
  true
47843
47841
  )[0];
47844
- let restoreEnclosingDeclaration;
47845
- if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
47846
- const locals = (_a2 = context.fakeScopeLocals) != null ? _a2 : context.fakeScopeLocals = createSymbolTable();
47847
- let newLocals;
47848
- for (const param of expandedParams) {
47849
- if (!locals.has(param.escapedName)) {
47850
- newLocals = append(newLocals, param.escapedName);
47851
- locals.set(param.escapedName, param);
47852
- }
47853
- }
47854
- if (newLocals) {
47855
- const fakeScope = parseNodeFactory.createBlock(emptyArray);
47856
- getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
47857
- fakeScope.locals = locals;
47858
- const saveEnclosingDeclaration = context.enclosingDeclaration;
47859
- setParent(fakeScope, saveEnclosingDeclaration);
47860
- context.enclosingDeclaration = fakeScope;
47861
- restoreEnclosingDeclaration = () => {
47862
- context.enclosingDeclaration = saveEnclosingDeclaration;
47863
- forEach(newLocals, (s) => locals.delete(s));
47864
- };
47865
- }
47866
- }
47867
47842
  const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 173 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
47868
47843
  const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
47869
47844
  if (thisParameter) {
@@ -47889,11 +47864,11 @@ function createTypeChecker(host) {
47889
47864
  const flags = modifiersToFlags(modifiers);
47890
47865
  modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
47891
47866
  }
47892
- const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
47867
+ const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
47893
47868
  modifiers,
47894
47869
  /*asteriskToken*/
47895
47870
  void 0,
47896
- (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
47871
+ (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""),
47897
47872
  /*questionToken*/
47898
47873
  void 0,
47899
47874
  typeParameters,
@@ -47908,14 +47883,14 @@ function createTypeChecker(host) {
47908
47883
  void 0
47909
47884
  ) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration(
47910
47885
  modifiers,
47911
- (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
47886
+ (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
47912
47887
  parameters,
47913
47888
  returnTypeNode,
47914
47889
  /*body*/
47915
47890
  void 0
47916
47891
  ) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration(
47917
47892
  modifiers,
47918
- (_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""),
47893
+ (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
47919
47894
  parameters,
47920
47895
  /*body*/
47921
47896
  void 0
@@ -47950,7 +47925,6 @@ function createTypeChecker(host) {
47950
47925
  if (typeArguments) {
47951
47926
  node.typeArguments = factory.createNodeArray(typeArguments);
47952
47927
  }
47953
- restoreEnclosingDeclaration == null ? void 0 : restoreEnclosingDeclaration();
47954
47928
  return node;
47955
47929
  }
47956
47930
  function tryGetThisParameterDeclaration(signature, context) {
@@ -48565,12 +48539,9 @@ function createTypeChecker(host) {
48565
48539
  function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
48566
48540
  return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
48567
48541
  }
48568
- function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
48569
- return findAncestor(enclosingDeclaration, (n) => !getNodeLinks(n).fakeScopeForSignatureDeclaration);
48570
- }
48571
48542
  function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
48572
48543
  if (!isErrorType(type) && enclosingDeclaration) {
48573
- const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration));
48544
+ const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
48574
48545
  if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
48575
48546
  const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
48576
48547
  if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
@@ -48602,8 +48573,7 @@ function createTypeChecker(host) {
48602
48573
  function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
48603
48574
  if (!isErrorType(type) && context.enclosingDeclaration) {
48604
48575
  const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
48605
- const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
48606
- if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
48576
+ if (!!findAncestor(annotation, (n) => n === context.enclosingDeclaration) && annotation) {
48607
48577
  const annotated = getTypeFromTypeNode(annotation);
48608
48578
  const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
48609
48579
  if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
@@ -53090,6 +53060,7 @@ function createTypeChecker(host) {
53090
53060
  const typeParameter = getTypeParameterFromMappedType(type);
53091
53061
  const constraintType = getConstraintTypeFromMappedType(type);
53092
53062
  const nameType = getNameTypeFromMappedType(type.target || type);
53063
+ const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
53093
53064
  const templateType = getTemplateTypeFromMappedType(type.target || type);
53094
53065
  const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
53095
53066
  const templateModifiers = getMappedTypeModifiers(type);
@@ -53127,7 +53098,7 @@ function createTypeChecker(host) {
53127
53098
  prop.links.keyType = keyType;
53128
53099
  if (modifiersProp) {
53129
53100
  prop.links.syntheticOrigin = modifiersProp;
53130
- prop.declarations = nameType ? void 0 : modifiersProp.declarations;
53101
+ prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
53131
53102
  }
53132
53103
  members.set(propName, prop);
53133
53104
  }
@@ -69686,7 +69657,7 @@ function createTypeChecker(host) {
69686
69657
  const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
69687
69658
  const isDecorator2 = node.kind === 167 /* Decorator */;
69688
69659
  const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
69689
- const reportErrors2 = !candidatesOutArray;
69660
+ const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray;
69690
69661
  let typeArguments;
69691
69662
  if (!isDecorator2 && !isSuperCall(node)) {
69692
69663
  typeArguments = node.typeArguments;
@@ -74764,6 +74735,17 @@ function createTypeChecker(host) {
74764
74735
  lastSeenNonAmbientDeclaration = node;
74765
74736
  }
74766
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
+ }
74767
74749
  }
74768
74750
  }
74769
74751
  if (multipleConstructorImplementation) {
@@ -74801,8 +74783,9 @@ function createTypeChecker(host) {
74801
74783
  const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
74802
74784
  for (const signature of signatures) {
74803
74785
  if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
74786
+ const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
74804
74787
  addRelatedInfo(
74805
- 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),
74806
74789
  createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
74807
74790
  );
74808
74791
  break;
@@ -81418,7 +81401,6 @@ function createTypeChecker(host) {
81418
81401
  case 299 /* PropertyAssignment */:
81419
81402
  case 300 /* ShorthandPropertyAssignment */:
81420
81403
  case 267 /* NamespaceExportDeclaration */:
81421
- case 181 /* FunctionType */:
81422
81404
  case 279 /* MissingDeclaration */:
81423
81405
  return find(node.modifiers, isModifier);
81424
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 {
@@ -52400,7 +52429,7 @@ function createTypeChecker(host) {
52400
52429
  );
52401
52430
  }
52402
52431
  function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
52403
- var _a2, _b, _c, _d, _e;
52432
+ var _a2, _b, _c, _d;
52404
52433
  const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
52405
52434
  if (suppressAny)
52406
52435
  context.flags &= ~256 /* SuppressAnyReturnType */;
@@ -52417,29 +52446,6 @@ function createTypeChecker(host) {
52417
52446
  /*skipUnionExpanding*/
52418
52447
  true
52419
52448
  )[0];
52420
- let restoreEnclosingDeclaration;
52421
- if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
52422
- const locals = (_a2 = context.fakeScopeLocals) != null ? _a2 : context.fakeScopeLocals = createSymbolTable();
52423
- let newLocals;
52424
- for (const param of expandedParams) {
52425
- if (!locals.has(param.escapedName)) {
52426
- newLocals = append(newLocals, param.escapedName);
52427
- locals.set(param.escapedName, param);
52428
- }
52429
- }
52430
- if (newLocals) {
52431
- const fakeScope = parseNodeFactory.createBlock(emptyArray);
52432
- getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
52433
- fakeScope.locals = locals;
52434
- const saveEnclosingDeclaration = context.enclosingDeclaration;
52435
- setParent(fakeScope, saveEnclosingDeclaration);
52436
- context.enclosingDeclaration = fakeScope;
52437
- restoreEnclosingDeclaration = () => {
52438
- context.enclosingDeclaration = saveEnclosingDeclaration;
52439
- forEach(newLocals, (s) => locals.delete(s));
52440
- };
52441
- }
52442
- }
52443
52449
  const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 173 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
52444
52450
  const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
52445
52451
  if (thisParameter) {
@@ -52465,11 +52471,11 @@ function createTypeChecker(host) {
52465
52471
  const flags = modifiersToFlags(modifiers);
52466
52472
  modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
52467
52473
  }
52468
- const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
52474
+ const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
52469
52475
  modifiers,
52470
52476
  /*asteriskToken*/
52471
52477
  void 0,
52472
- (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
52478
+ (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""),
52473
52479
  /*questionToken*/
52474
52480
  void 0,
52475
52481
  typeParameters,
@@ -52484,14 +52490,14 @@ function createTypeChecker(host) {
52484
52490
  void 0
52485
52491
  ) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration(
52486
52492
  modifiers,
52487
- (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
52493
+ (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
52488
52494
  parameters,
52489
52495
  returnTypeNode,
52490
52496
  /*body*/
52491
52497
  void 0
52492
52498
  ) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration(
52493
52499
  modifiers,
52494
- (_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""),
52500
+ (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
52495
52501
  parameters,
52496
52502
  /*body*/
52497
52503
  void 0
@@ -52526,7 +52532,6 @@ function createTypeChecker(host) {
52526
52532
  if (typeArguments) {
52527
52533
  node.typeArguments = factory.createNodeArray(typeArguments);
52528
52534
  }
52529
- restoreEnclosingDeclaration == null ? void 0 : restoreEnclosingDeclaration();
52530
52535
  return node;
52531
52536
  }
52532
52537
  function tryGetThisParameterDeclaration(signature, context) {
@@ -53141,12 +53146,9 @@ function createTypeChecker(host) {
53141
53146
  function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
53142
53147
  return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
53143
53148
  }
53144
- function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
53145
- return findAncestor(enclosingDeclaration, (n) => !getNodeLinks(n).fakeScopeForSignatureDeclaration);
53146
- }
53147
53149
  function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
53148
53150
  if (!isErrorType(type) && enclosingDeclaration) {
53149
- const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration));
53151
+ const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
53150
53152
  if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
53151
53153
  const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
53152
53154
  if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
@@ -53178,8 +53180,7 @@ function createTypeChecker(host) {
53178
53180
  function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
53179
53181
  if (!isErrorType(type) && context.enclosingDeclaration) {
53180
53182
  const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
53181
- const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
53182
- if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
53183
+ if (!!findAncestor(annotation, (n) => n === context.enclosingDeclaration) && annotation) {
53183
53184
  const annotated = getTypeFromTypeNode(annotation);
53184
53185
  const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
53185
53186
  if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
@@ -57666,6 +57667,7 @@ function createTypeChecker(host) {
57666
57667
  const typeParameter = getTypeParameterFromMappedType(type);
57667
57668
  const constraintType = getConstraintTypeFromMappedType(type);
57668
57669
  const nameType = getNameTypeFromMappedType(type.target || type);
57670
+ const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
57669
57671
  const templateType = getTemplateTypeFromMappedType(type.target || type);
57670
57672
  const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
57671
57673
  const templateModifiers = getMappedTypeModifiers(type);
@@ -57703,7 +57705,7 @@ function createTypeChecker(host) {
57703
57705
  prop.links.keyType = keyType;
57704
57706
  if (modifiersProp) {
57705
57707
  prop.links.syntheticOrigin = modifiersProp;
57706
- prop.declarations = nameType ? void 0 : modifiersProp.declarations;
57708
+ prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
57707
57709
  }
57708
57710
  members.set(propName, prop);
57709
57711
  }
@@ -74262,7 +74264,7 @@ function createTypeChecker(host) {
74262
74264
  const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
74263
74265
  const isDecorator2 = node.kind === 167 /* Decorator */;
74264
74266
  const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
74265
- const reportErrors2 = !candidatesOutArray;
74267
+ const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray;
74266
74268
  let typeArguments;
74267
74269
  if (!isDecorator2 && !isSuperCall(node)) {
74268
74270
  typeArguments = node.typeArguments;
@@ -79340,6 +79342,17 @@ function createTypeChecker(host) {
79340
79342
  lastSeenNonAmbientDeclaration = node;
79341
79343
  }
79342
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
+ }
79343
79356
  }
79344
79357
  }
79345
79358
  if (multipleConstructorImplementation) {
@@ -79377,8 +79390,9 @@ function createTypeChecker(host) {
79377
79390
  const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
79378
79391
  for (const signature of signatures) {
79379
79392
  if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
79393
+ const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
79380
79394
  addRelatedInfo(
79381
- 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),
79382
79396
  createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
79383
79397
  );
79384
79398
  break;
@@ -85994,7 +86008,6 @@ function createTypeChecker(host) {
85994
86008
  case 299 /* PropertyAssignment */:
85995
86009
  case 300 /* ShorthandPropertyAssignment */:
85996
86010
  case 267 /* NamespaceExportDeclaration */:
85997
- case 181 /* FunctionType */:
85998
86011
  case 279 /* MissingDeclaration */:
85999
86012
  return find(node.modifiers, isModifier);
86000
86013
  default:
@@ -147277,7 +147290,14 @@ function updatePropertyDeclaration(changeTracker, file, declaration, type, field
147277
147290
  changeTracker.replaceNode(file, declaration, property);
147278
147291
  }
147279
147292
  function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) {
147280
- 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
+ }
147281
147301
  changeTracker.replacePropertyAssignment(file, declaration, assignment);
147282
147302
  }
147283
147303
  function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {
@@ -166476,7 +166496,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
166476
166496
  }
166477
166497
  if (isToken(child)) {
166478
166498
  const tokenInfo = formattingScanner.readTokenInfo(child);
166479
- if (child.kind !== 11 /* JsxText */) {
166499
+ if (child.kind !== 11 /* JsxText */ && !isGrammarError(parent2, child)) {
166480
166500
  Debug.assert(tokenInfo.token.end === child.end, "Token end is child end");
166481
166501
  consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);
166482
166502
  return inheritedIndentation;
@@ -168846,6 +168866,7 @@ __export(ts_exports3, {
168846
168866
  isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
168847
168867
  isGlobalDeclaration: () => isGlobalDeclaration,
168848
168868
  isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
168869
+ isGrammarError: () => isGrammarError,
168849
168870
  isHeritageClause: () => isHeritageClause,
168850
168871
  isHoistedFunction: () => isHoistedFunction,
168851
168872
  isHoistedVariableStatement: () => isHoistedVariableStatement,
@@ -182795,6 +182816,7 @@ start(initializeNodeSystem(), require("os").platform());
182795
182816
  isGetOrSetAccessorDeclaration,
182796
182817
  isGlobalDeclaration,
182797
182818
  isGlobalScopeAugmentation,
182819
+ isGrammarError,
182798
182820
  isHeritageClause,
182799
182821
  isHoistedFunction,
182800
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 {
@@ -50209,7 +50237,7 @@ ${lanes.join("\n")}
50209
50237
  );
50210
50238
  }
50211
50239
  function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
50212
- var _a2, _b, _c, _d, _e;
50240
+ var _a2, _b, _c, _d;
50213
50241
  const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
50214
50242
  if (suppressAny)
50215
50243
  context.flags &= ~256 /* SuppressAnyReturnType */;
@@ -50226,29 +50254,6 @@ ${lanes.join("\n")}
50226
50254
  /*skipUnionExpanding*/
50227
50255
  true
50228
50256
  )[0];
50229
- let restoreEnclosingDeclaration;
50230
- if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
50231
- const locals = (_a2 = context.fakeScopeLocals) != null ? _a2 : context.fakeScopeLocals = createSymbolTable();
50232
- let newLocals;
50233
- for (const param of expandedParams) {
50234
- if (!locals.has(param.escapedName)) {
50235
- newLocals = append(newLocals, param.escapedName);
50236
- locals.set(param.escapedName, param);
50237
- }
50238
- }
50239
- if (newLocals) {
50240
- const fakeScope = parseNodeFactory.createBlock(emptyArray);
50241
- getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
50242
- fakeScope.locals = locals;
50243
- const saveEnclosingDeclaration = context.enclosingDeclaration;
50244
- setParent(fakeScope, saveEnclosingDeclaration);
50245
- context.enclosingDeclaration = fakeScope;
50246
- restoreEnclosingDeclaration = () => {
50247
- context.enclosingDeclaration = saveEnclosingDeclaration;
50248
- forEach(newLocals, (s) => locals.delete(s));
50249
- };
50250
- }
50251
- }
50252
50257
  const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 173 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
50253
50258
  const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
50254
50259
  if (thisParameter) {
@@ -50274,11 +50279,11 @@ ${lanes.join("\n")}
50274
50279
  const flags = modifiersToFlags(modifiers);
50275
50280
  modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
50276
50281
  }
50277
- const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
50282
+ const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
50278
50283
  modifiers,
50279
50284
  /*asteriskToken*/
50280
50285
  void 0,
50281
- (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
50286
+ (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""),
50282
50287
  /*questionToken*/
50283
50288
  void 0,
50284
50289
  typeParameters,
@@ -50293,14 +50298,14 @@ ${lanes.join("\n")}
50293
50298
  void 0
50294
50299
  ) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration(
50295
50300
  modifiers,
50296
- (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
50301
+ (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
50297
50302
  parameters,
50298
50303
  returnTypeNode,
50299
50304
  /*body*/
50300
50305
  void 0
50301
50306
  ) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration(
50302
50307
  modifiers,
50303
- (_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""),
50308
+ (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
50304
50309
  parameters,
50305
50310
  /*body*/
50306
50311
  void 0
@@ -50335,7 +50340,6 @@ ${lanes.join("\n")}
50335
50340
  if (typeArguments) {
50336
50341
  node.typeArguments = factory.createNodeArray(typeArguments);
50337
50342
  }
50338
- restoreEnclosingDeclaration == null ? void 0 : restoreEnclosingDeclaration();
50339
50343
  return node;
50340
50344
  }
50341
50345
  function tryGetThisParameterDeclaration(signature, context) {
@@ -50950,12 +50954,9 @@ ${lanes.join("\n")}
50950
50954
  function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
50951
50955
  return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
50952
50956
  }
50953
- function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
50954
- return findAncestor(enclosingDeclaration, (n) => !getNodeLinks(n).fakeScopeForSignatureDeclaration);
50955
- }
50956
50957
  function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
50957
50958
  if (!isErrorType(type) && enclosingDeclaration) {
50958
- const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration));
50959
+ const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
50959
50960
  if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
50960
50961
  const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
50961
50962
  if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
@@ -50987,8 +50988,7 @@ ${lanes.join("\n")}
50987
50988
  function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
50988
50989
  if (!isErrorType(type) && context.enclosingDeclaration) {
50989
50990
  const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
50990
- const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
50991
- if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
50991
+ if (!!findAncestor(annotation, (n) => n === context.enclosingDeclaration) && annotation) {
50992
50992
  const annotated = getTypeFromTypeNode(annotation);
50993
50993
  const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
50994
50994
  if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
@@ -55475,6 +55475,7 @@ ${lanes.join("\n")}
55475
55475
  const typeParameter = getTypeParameterFromMappedType(type);
55476
55476
  const constraintType = getConstraintTypeFromMappedType(type);
55477
55477
  const nameType = getNameTypeFromMappedType(type.target || type);
55478
+ const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
55478
55479
  const templateType = getTemplateTypeFromMappedType(type.target || type);
55479
55480
  const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
55480
55481
  const templateModifiers = getMappedTypeModifiers(type);
@@ -55512,7 +55513,7 @@ ${lanes.join("\n")}
55512
55513
  prop.links.keyType = keyType;
55513
55514
  if (modifiersProp) {
55514
55515
  prop.links.syntheticOrigin = modifiersProp;
55515
- prop.declarations = nameType ? void 0 : modifiersProp.declarations;
55516
+ prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
55516
55517
  }
55517
55518
  members.set(propName, prop);
55518
55519
  }
@@ -72071,7 +72072,7 @@ ${lanes.join("\n")}
72071
72072
  const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
72072
72073
  const isDecorator2 = node.kind === 167 /* Decorator */;
72073
72074
  const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
72074
- const reportErrors2 = !candidatesOutArray;
72075
+ const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray;
72075
72076
  let typeArguments;
72076
72077
  if (!isDecorator2 && !isSuperCall(node)) {
72077
72078
  typeArguments = node.typeArguments;
@@ -77149,6 +77150,17 @@ ${lanes.join("\n")}
77149
77150
  lastSeenNonAmbientDeclaration = node;
77150
77151
  }
77151
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
+ }
77152
77164
  }
77153
77165
  }
77154
77166
  if (multipleConstructorImplementation) {
@@ -77186,8 +77198,9 @@ ${lanes.join("\n")}
77186
77198
  const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
77187
77199
  for (const signature of signatures) {
77188
77200
  if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
77201
+ const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
77189
77202
  addRelatedInfo(
77190
- 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),
77191
77204
  createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
77192
77205
  );
77193
77206
  break;
@@ -83803,7 +83816,6 @@ ${lanes.join("\n")}
83803
83816
  case 299 /* PropertyAssignment */:
83804
83817
  case 300 /* ShorthandPropertyAssignment */:
83805
83818
  case 267 /* NamespaceExportDeclaration */:
83806
- case 181 /* FunctionType */:
83807
83819
  case 279 /* MissingDeclaration */:
83808
83820
  return find(node.modifiers, isModifier);
83809
83821
  default:
@@ -146161,7 +146173,14 @@ ${lanes.join("\n")}
146161
146173
  changeTracker.replaceNode(file, declaration, property);
146162
146174
  }
146163
146175
  function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) {
146164
- 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
+ }
146165
146184
  changeTracker.replacePropertyAssignment(file, declaration, assignment);
146166
146185
  }
146167
146186
  function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {
@@ -165967,7 +165986,7 @@ ${options.prefix}` : "\n" : options.prefix
165967
165986
  }
165968
165987
  if (isToken(child)) {
165969
165988
  const tokenInfo = formattingScanner.readTokenInfo(child);
165970
- if (child.kind !== 11 /* JsxText */) {
165989
+ if (child.kind !== 11 /* JsxText */ && !isGrammarError(parent2, child)) {
165971
165990
  Debug.assert(tokenInfo.token.end === child.end, "Token end is child end");
165972
165991
  consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);
165973
165992
  return inheritedIndentation;
@@ -179433,6 +179452,7 @@ ${e.message}`;
179433
179452
  isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
179434
179453
  isGlobalDeclaration: () => isGlobalDeclaration,
179435
179454
  isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
179455
+ isGrammarError: () => isGrammarError,
179436
179456
  isHeritageClause: () => isHeritageClause,
179437
179457
  isHoistedFunction: () => isHoistedFunction,
179438
179458
  isHoistedVariableStatement: () => isHoistedVariableStatement,
@@ -181792,6 +181812,7 @@ ${e.message}`;
181792
181812
  isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
181793
181813
  isGlobalDeclaration: () => isGlobalDeclaration,
181794
181814
  isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
181815
+ isGrammarError: () => isGrammarError,
181795
181816
  isHeritageClause: () => isHeritageClause,
181796
181817
  isHoistedFunction: () => isHoistedFunction,
181797
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 {
@@ -50209,7 +50237,7 @@ ${lanes.join("\n")}
50209
50237
  );
50210
50238
  }
50211
50239
  function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
50212
- var _a2, _b, _c, _d, _e;
50240
+ var _a2, _b, _c, _d;
50213
50241
  const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
50214
50242
  if (suppressAny)
50215
50243
  context.flags &= ~256 /* SuppressAnyReturnType */;
@@ -50226,29 +50254,6 @@ ${lanes.join("\n")}
50226
50254
  /*skipUnionExpanding*/
50227
50255
  true
50228
50256
  )[0];
50229
- let restoreEnclosingDeclaration;
50230
- if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
50231
- const locals = (_a2 = context.fakeScopeLocals) != null ? _a2 : context.fakeScopeLocals = createSymbolTable();
50232
- let newLocals;
50233
- for (const param of expandedParams) {
50234
- if (!locals.has(param.escapedName)) {
50235
- newLocals = append(newLocals, param.escapedName);
50236
- locals.set(param.escapedName, param);
50237
- }
50238
- }
50239
- if (newLocals) {
50240
- const fakeScope = parseNodeFactory.createBlock(emptyArray);
50241
- getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
50242
- fakeScope.locals = locals;
50243
- const saveEnclosingDeclaration = context.enclosingDeclaration;
50244
- setParent(fakeScope, saveEnclosingDeclaration);
50245
- context.enclosingDeclaration = fakeScope;
50246
- restoreEnclosingDeclaration = () => {
50247
- context.enclosingDeclaration = saveEnclosingDeclaration;
50248
- forEach(newLocals, (s) => locals.delete(s));
50249
- };
50250
- }
50251
- }
50252
50257
  const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 173 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
50253
50258
  const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
50254
50259
  if (thisParameter) {
@@ -50274,11 +50279,11 @@ ${lanes.join("\n")}
50274
50279
  const flags = modifiersToFlags(modifiers);
50275
50280
  modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
50276
50281
  }
50277
- const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
50282
+ const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
50278
50283
  modifiers,
50279
50284
  /*asteriskToken*/
50280
50285
  void 0,
50281
- (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
50286
+ (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""),
50282
50287
  /*questionToken*/
50283
50288
  void 0,
50284
50289
  typeParameters,
@@ -50293,14 +50298,14 @@ ${lanes.join("\n")}
50293
50298
  void 0
50294
50299
  ) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration(
50295
50300
  modifiers,
50296
- (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
50301
+ (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
50297
50302
  parameters,
50298
50303
  returnTypeNode,
50299
50304
  /*body*/
50300
50305
  void 0
50301
50306
  ) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration(
50302
50307
  modifiers,
50303
- (_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""),
50308
+ (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
50304
50309
  parameters,
50305
50310
  /*body*/
50306
50311
  void 0
@@ -50335,7 +50340,6 @@ ${lanes.join("\n")}
50335
50340
  if (typeArguments) {
50336
50341
  node.typeArguments = factory.createNodeArray(typeArguments);
50337
50342
  }
50338
- restoreEnclosingDeclaration == null ? void 0 : restoreEnclosingDeclaration();
50339
50343
  return node;
50340
50344
  }
50341
50345
  function tryGetThisParameterDeclaration(signature, context) {
@@ -50950,12 +50954,9 @@ ${lanes.join("\n")}
50950
50954
  function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
50951
50955
  return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
50952
50956
  }
50953
- function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
50954
- return findAncestor(enclosingDeclaration, (n) => !getNodeLinks(n).fakeScopeForSignatureDeclaration);
50955
- }
50956
50957
  function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
50957
50958
  if (!isErrorType(type) && enclosingDeclaration) {
50958
- const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration));
50959
+ const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
50959
50960
  if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
50960
50961
  const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
50961
50962
  if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
@@ -50987,8 +50988,7 @@ ${lanes.join("\n")}
50987
50988
  function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
50988
50989
  if (!isErrorType(type) && context.enclosingDeclaration) {
50989
50990
  const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
50990
- const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
50991
- if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
50991
+ if (!!findAncestor(annotation, (n) => n === context.enclosingDeclaration) && annotation) {
50992
50992
  const annotated = getTypeFromTypeNode(annotation);
50993
50993
  const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
50994
50994
  if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
@@ -55475,6 +55475,7 @@ ${lanes.join("\n")}
55475
55475
  const typeParameter = getTypeParameterFromMappedType(type);
55476
55476
  const constraintType = getConstraintTypeFromMappedType(type);
55477
55477
  const nameType = getNameTypeFromMappedType(type.target || type);
55478
+ const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
55478
55479
  const templateType = getTemplateTypeFromMappedType(type.target || type);
55479
55480
  const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
55480
55481
  const templateModifiers = getMappedTypeModifiers(type);
@@ -55512,7 +55513,7 @@ ${lanes.join("\n")}
55512
55513
  prop.links.keyType = keyType;
55513
55514
  if (modifiersProp) {
55514
55515
  prop.links.syntheticOrigin = modifiersProp;
55515
- prop.declarations = nameType ? void 0 : modifiersProp.declarations;
55516
+ prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
55516
55517
  }
55517
55518
  members.set(propName, prop);
55518
55519
  }
@@ -72071,7 +72072,7 @@ ${lanes.join("\n")}
72071
72072
  const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
72072
72073
  const isDecorator2 = node.kind === 167 /* Decorator */;
72073
72074
  const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
72074
- const reportErrors2 = !candidatesOutArray;
72075
+ const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray;
72075
72076
  let typeArguments;
72076
72077
  if (!isDecorator2 && !isSuperCall(node)) {
72077
72078
  typeArguments = node.typeArguments;
@@ -77149,6 +77150,17 @@ ${lanes.join("\n")}
77149
77150
  lastSeenNonAmbientDeclaration = node;
77150
77151
  }
77151
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
+ }
77152
77164
  }
77153
77165
  }
77154
77166
  if (multipleConstructorImplementation) {
@@ -77186,8 +77198,9 @@ ${lanes.join("\n")}
77186
77198
  const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
77187
77199
  for (const signature of signatures) {
77188
77200
  if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
77201
+ const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
77189
77202
  addRelatedInfo(
77190
- 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),
77191
77204
  createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
77192
77205
  );
77193
77206
  break;
@@ -83803,7 +83816,6 @@ ${lanes.join("\n")}
83803
83816
  case 299 /* PropertyAssignment */:
83804
83817
  case 300 /* ShorthandPropertyAssignment */:
83805
83818
  case 267 /* NamespaceExportDeclaration */:
83806
- case 181 /* FunctionType */:
83807
83819
  case 279 /* MissingDeclaration */:
83808
83820
  return find(node.modifiers, isModifier);
83809
83821
  default:
@@ -146175,7 +146187,14 @@ ${lanes.join("\n")}
146175
146187
  changeTracker.replaceNode(file, declaration, property);
146176
146188
  }
146177
146189
  function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) {
146178
- 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
+ }
146179
146198
  changeTracker.replacePropertyAssignment(file, declaration, assignment);
146180
146199
  }
146181
146200
  function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {
@@ -165981,7 +166000,7 @@ ${options.prefix}` : "\n" : options.prefix
165981
166000
  }
165982
166001
  if (isToken(child)) {
165983
166002
  const tokenInfo = formattingScanner.readTokenInfo(child);
165984
- if (child.kind !== 11 /* JsxText */) {
166003
+ if (child.kind !== 11 /* JsxText */ && !isGrammarError(parent2, child)) {
165985
166004
  Debug.assert(tokenInfo.token.end === child.end, "Token end is child end");
165986
166005
  consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);
165987
166006
  return inheritedIndentation;
@@ -168614,6 +168633,7 @@ ${options.prefix}` : "\n" : options.prefix
168614
168633
  isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
168615
168634
  isGlobalDeclaration: () => isGlobalDeclaration,
168616
168635
  isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
168636
+ isGrammarError: () => isGrammarError,
168617
168637
  isHeritageClause: () => isHeritageClause,
168618
168638
  isHoistedFunction: () => isHoistedFunction,
168619
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-49627-28",
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": [