typescript 5.2.0-dev.20230720 → 5.2.0-dev.20230721

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/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-dev.20230720`;
38
+ version = `${versionMajorMinor}.0-dev.20230721`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -19225,6 +19225,18 @@ ${lanes.join("\n")}
19225
19225
  function intrinsicTagNameToString(node) {
19226
19226
  return isIdentifier(node) ? idText(node) : getTextOfJsxNamespacedName(node);
19227
19227
  }
19228
+ function isTypeUsableAsPropertyName(type) {
19229
+ return !!(type.flags & 8576 /* StringOrNumberLiteralOrUnique */);
19230
+ }
19231
+ function getPropertyNameFromType(type) {
19232
+ if (type.flags & 8192 /* UniqueESSymbol */) {
19233
+ return type.escapedName;
19234
+ }
19235
+ if (type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) {
19236
+ return escapeLeadingUnderscores("" + type.value);
19237
+ }
19238
+ return Debug.fail();
19239
+ }
19228
19240
  var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
19229
19241
  var init_utilities = __esm({
19230
19242
  "src/compiler/utilities.ts"() {
@@ -33182,10 +33194,14 @@ ${lanes.join("\n")}
33182
33194
  case 124 /* ProtectedKeyword */:
33183
33195
  case 125 /* PublicKeyword */:
33184
33196
  case 148 /* ReadonlyKeyword */:
33197
+ const previousToken = token();
33185
33198
  nextToken();
33186
33199
  if (scanner2.hasPrecedingLineBreak()) {
33187
33200
  return false;
33188
33201
  }
33202
+ if (previousToken === 138 /* DeclareKeyword */ && token() === 156 /* TypeKeyword */) {
33203
+ return true;
33204
+ }
33189
33205
  continue;
33190
33206
  case 162 /* GlobalKeyword */:
33191
33207
  nextToken();
@@ -33550,14 +33566,14 @@ ${lanes.join("\n")}
33550
33566
  function parseObjectBindingPattern() {
33551
33567
  const pos = getNodePos();
33552
33568
  parseExpected(19 /* OpenBraceToken */);
33553
- const elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement);
33569
+ const elements = allowInAnd(() => parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement));
33554
33570
  parseExpected(20 /* CloseBraceToken */);
33555
33571
  return finishNode(factory2.createObjectBindingPattern(elements), pos);
33556
33572
  }
33557
33573
  function parseArrayBindingPattern() {
33558
33574
  const pos = getNodePos();
33559
33575
  parseExpected(23 /* OpenBracketToken */);
33560
- const elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement);
33576
+ const elements = allowInAnd(() => parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement));
33561
33577
  parseExpected(24 /* CloseBracketToken */);
33562
33578
  return finishNode(factory2.createArrayBindingPattern(elements), pos);
33563
33579
  }
@@ -34075,6 +34091,9 @@ ${lanes.join("\n")}
34075
34091
  }
34076
34092
  function parseTypeAliasDeclaration(pos, hasJSDoc, modifiers) {
34077
34093
  parseExpected(156 /* TypeKeyword */);
34094
+ if (scanner2.hasPrecedingLineBreak()) {
34095
+ parseErrorAtCurrentToken(Diagnostics.Line_break_not_permitted_here);
34096
+ }
34078
34097
  const name = parseIdentifier();
34079
34098
  const typeParameters = parseTypeParameters();
34080
34099
  parseExpected(64 /* EqualsToken */);
@@ -45585,7 +45604,7 @@ ${lanes.join("\n")}
45585
45604
  return node ? getTypeFromTypeNode(node) : errorType;
45586
45605
  },
45587
45606
  getParameterType: getTypeAtPosition,
45588
- getParameterIdentifierNameAtPosition,
45607
+ getParameterIdentifierInfoAtPosition,
45589
45608
  getPromisedTypeOfPromise,
45590
45609
  getAwaitedType: (type) => getAwaitedType(type),
45591
45610
  getReturnTypeOfSignature,
@@ -54048,7 +54067,7 @@ ${lanes.join("\n")}
54048
54067
  false,
54049
54068
  definedInMethod && !definedInConstructor
54050
54069
  ));
54051
- if (symbol.valueDeclaration && filterType(widened, (t) => !!(t.flags & ~98304 /* Nullable */)) === neverType) {
54070
+ if (symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && filterType(widened, (t) => !!(t.flags & ~98304 /* Nullable */)) === neverType) {
54052
54071
  reportImplicitAny(symbol.valueDeclaration, anyType);
54053
54072
  return anyType;
54054
54073
  }
@@ -55327,9 +55346,6 @@ ${lanes.join("\n")}
55327
55346
  }
55328
55347
  return type;
55329
55348
  }
55330
- function isTypeUsableAsPropertyName(type) {
55331
- return !!(type.flags & 8576 /* StringOrNumberLiteralOrUnique */);
55332
- }
55333
55349
  function isLateBindableName(node) {
55334
55350
  if (!isComputedPropertyName(node) && !isElementAccessExpression(node)) {
55335
55351
  return false;
@@ -55350,15 +55366,6 @@ ${lanes.join("\n")}
55350
55366
  function isNonBindableDynamicName(node) {
55351
55367
  return isDynamicName(node) && !isLateBindableName(node);
55352
55368
  }
55353
- function getPropertyNameFromType(type) {
55354
- if (type.flags & 8192 /* UniqueESSymbol */) {
55355
- return type.escapedName;
55356
- }
55357
- if (type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */)) {
55358
- return escapeLeadingUnderscores("" + type.value);
55359
- }
55360
- return Debug.fail();
55361
- }
55362
55369
  function addDeclarationToLateBoundSymbol(symbol, member, symbolFlags) {
55363
55370
  Debug.assert(!!(getCheckFlags(symbol) & 4096 /* Late */), "Expected a late-bound symbol.");
55364
55371
  symbol.flags |= symbolFlags;
@@ -56005,20 +56012,17 @@ ${lanes.join("\n")}
56005
56012
  setStructuredTypeMembers(type, members2, callSignatures, constructSignatures, indexInfos2);
56006
56013
  return;
56007
56014
  }
56008
- let members = emptySymbols;
56015
+ let members = getExportsOfSymbol(symbol);
56009
56016
  let indexInfos;
56010
- if (symbol.exports) {
56011
- members = getExportsOfSymbol(symbol);
56012
- if (symbol === globalThisSymbol) {
56013
- const varsOnly = /* @__PURE__ */ new Map();
56014
- members.forEach((p) => {
56015
- var _a;
56016
- if (!(p.flags & 418 /* BlockScoped */) && !(p.flags & 512 /* ValueModule */ && ((_a = p.declarations) == null ? void 0 : _a.length) && every(p.declarations, isAmbientModule))) {
56017
- varsOnly.set(p.escapedName, p);
56018
- }
56019
- });
56020
- members = varsOnly;
56021
- }
56017
+ if (symbol === globalThisSymbol) {
56018
+ const varsOnly = /* @__PURE__ */ new Map();
56019
+ members.forEach((p) => {
56020
+ var _a;
56021
+ if (!(p.flags & 418 /* BlockScoped */) && !(p.flags & 512 /* ValueModule */ && ((_a = p.declarations) == null ? void 0 : _a.length) && every(p.declarations, isAmbientModule))) {
56022
+ varsOnly.set(p.escapedName, p);
56023
+ }
56024
+ });
56025
+ members = varsOnly;
56022
56026
  }
56023
56027
  let baseConstructorIndexInfo;
56024
56028
  setStructuredTypeMembers(type, members, emptyArray, emptyArray, emptyArray);
@@ -74530,7 +74534,7 @@ ${lanes.join("\n")}
74530
74534
  }
74531
74535
  return restParameter.escapedName;
74532
74536
  }
74533
- function getParameterIdentifierNameAtPosition(signature, pos) {
74537
+ function getParameterIdentifierInfoAtPosition(signature, pos) {
74534
74538
  var _a;
74535
74539
  if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 324 /* JSDocFunctionType */) {
74536
74540
  return void 0;
@@ -74538,10 +74542,16 @@ ${lanes.join("\n")}
74538
74542
  const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
74539
74543
  if (pos < paramCount) {
74540
74544
  const param = signature.parameters[pos];
74541
- return isParameterDeclarationWithIdentifierName(param) ? [param.escapedName, false] : void 0;
74545
+ const paramIdent = getParameterDeclarationIdentifier(param);
74546
+ return paramIdent ? {
74547
+ parameter: paramIdent,
74548
+ parameterName: param.escapedName,
74549
+ isRestParameter: false
74550
+ } : void 0;
74542
74551
  }
74543
74552
  const restParameter = signature.parameters[paramCount] || unknownSymbol;
74544
- if (!isParameterDeclarationWithIdentifierName(restParameter)) {
74553
+ const restIdent = getParameterDeclarationIdentifier(restParameter);
74554
+ if (!restIdent) {
74545
74555
  return void 0;
74546
74556
  }
74547
74557
  const restType = getTypeOfSymbol(restParameter);
@@ -74550,18 +74560,19 @@ ${lanes.join("\n")}
74550
74560
  const index = pos - paramCount;
74551
74561
  const associatedName = associatedNames == null ? void 0 : associatedNames[index];
74552
74562
  const isRestTupleElement = !!(associatedName == null ? void 0 : associatedName.dotDotDotToken);
74553
- return associatedName ? [
74554
- getTupleElementLabel(associatedName),
74555
- isRestTupleElement
74556
- ] : void 0;
74563
+ if (associatedName) {
74564
+ Debug.assert(isIdentifier(associatedName.name));
74565
+ return { parameter: associatedName.name, parameterName: associatedName.name.escapedText, isRestParameter: isRestTupleElement };
74566
+ }
74567
+ return void 0;
74557
74568
  }
74558
74569
  if (pos === paramCount) {
74559
- return [restParameter.escapedName, true];
74570
+ return { parameter: restIdent, parameterName: restParameter.escapedName, isRestParameter: true };
74560
74571
  }
74561
74572
  return void 0;
74562
74573
  }
74563
- function isParameterDeclarationWithIdentifierName(symbol) {
74564
- return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name);
74574
+ function getParameterDeclarationIdentifier(symbol) {
74575
+ return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name) && symbol.valueDeclaration.name;
74565
74576
  }
74566
74577
  function isValidDeclarationForTupleLabel(d) {
74567
74578
  return d.kind === 202 /* NamedTupleMember */ || isParameter(d) && d.name && isIdentifier(d.name);
@@ -154185,15 +154196,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
154185
154196
  }
154186
154197
  function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, context, preferences, importAdder, addClassElement, body, preserveOptional = 3 /* All */, isAmbient = false) {
154187
154198
  const declarations = symbol.getDeclarations();
154188
- const declaration = declarations == null ? void 0 : declarations[0];
154199
+ const declaration = firstOrUndefined(declarations);
154189
154200
  const checker = context.program.getTypeChecker();
154190
154201
  const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions());
154191
154202
  const kind = (declaration == null ? void 0 : declaration.kind) ?? 171 /* PropertySignature */;
154192
- const declarationName = getSynthesizedDeepClone(
154193
- getNameOfDeclaration(declaration),
154194
- /*includeTrivia*/
154195
- false
154196
- );
154203
+ const declarationName = createDeclarationName(symbol, declaration);
154197
154204
  const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0 /* None */;
154198
154205
  let modifierFlags = effectiveModifierFlags & 32 /* Static */;
154199
154206
  modifierFlags |= effectiveModifierFlags & 4 /* Public */ ? 4 /* Public */ : effectiveModifierFlags & 16 /* Protected */ ? 16 /* Protected */ : 0 /* None */;
@@ -154344,6 +154351,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
154344
154351
  false
154345
154352
  );
154346
154353
  }
154354
+ function createDeclarationName(symbol2, declaration2) {
154355
+ if (getCheckFlags(symbol2) & 262144 /* Mapped */) {
154356
+ const nameType = symbol2.links.nameType;
154357
+ if (nameType && isTypeUsableAsPropertyName(nameType)) {
154358
+ return factory.createIdentifier(unescapeLeadingUnderscores(getPropertyNameFromType(nameType)));
154359
+ }
154360
+ }
154361
+ return getSynthesizedDeepClone(
154362
+ getNameOfDeclaration(declaration2),
154363
+ /*includeTrivia*/
154364
+ false
154365
+ );
154366
+ }
154347
154367
  }
154348
154368
  function createSignatureDeclarationFromSignature(kind, context, quotePreference, signature, body, name, modifiers, optional, enclosingDeclaration, importAdder) {
154349
154369
  const program = context.program;
@@ -163875,6 +163895,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163875
163895
  function shouldShowLiteralParameterNameHintsOnly(preferences) {
163876
163896
  return preferences.includeInlayParameterNameHints === "literals";
163877
163897
  }
163898
+ function shouldUseInteractiveInlayHints(preferences) {
163899
+ return preferences.interactiveInlayHints === true;
163900
+ }
163878
163901
  function provideInlayHints(context) {
163879
163902
  const { file, program, span, cancellationToken, preferences } = context;
163880
163903
  const sourceFileText = file.text;
@@ -163925,9 +163948,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163925
163948
  function isSignatureSupportingReturnAnnotation(node) {
163926
163949
  return isArrowFunction(node) || isFunctionExpression(node) || isFunctionDeclaration(node) || isMethodDeclaration(node) || isGetAccessorDeclaration(node);
163927
163950
  }
163928
- function addParameterHints(text, position, isFirstVariadicArgument) {
163951
+ function addParameterHints(text, parameter, position, isFirstVariadicArgument, sourceFile) {
163952
+ let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`;
163953
+ if (shouldUseInteractiveInlayHints(preferences)) {
163954
+ hintText = [getNodeDisplayPart(hintText, parameter, sourceFile), { text: ":" }];
163955
+ } else {
163956
+ hintText += ":";
163957
+ }
163929
163958
  result.push({
163930
- text: `${isFirstVariadicArgument ? "..." : ""}${truncation(text, maxHintsLength)}:`,
163959
+ text: hintText,
163931
163960
  position,
163932
163961
  kind: "Parameter" /* Parameter */,
163933
163962
  whitespaceAfter: true
@@ -163935,7 +163964,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163935
163964
  }
163936
163965
  function addTypeHints(text, position) {
163937
163966
  result.push({
163938
- text: `: ${truncation(text, maxHintsLength)}`,
163967
+ text: `: ${text.length > maxTypeHintLength ? text.substr(0, maxTypeHintLength - "...".length) + "..." : text}`,
163939
163968
  position,
163940
163969
  kind: "Type" /* Type */,
163941
163970
  whitespaceBefore: true
@@ -163943,7 +163972,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163943
163972
  }
163944
163973
  function addEnumMemberValueHints(text, position) {
163945
163974
  result.push({
163946
- text: `= ${truncation(text, maxHintsLength)}`,
163975
+ text: `= ${text}`,
163947
163976
  position,
163948
163977
  kind: "Enum" /* Enum */,
163949
163978
  whitespaceBefore: true
@@ -163993,6 +164022,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163993
164022
  return;
163994
164023
  }
163995
164024
  let signatureParamPos = 0;
164025
+ const sourceFile = shouldUseInteractiveInlayHints(preferences) ? expr.getSourceFile() : void 0;
163996
164026
  for (const originalArg of args) {
163997
164027
  const arg = skipParentheses(originalArg);
163998
164028
  if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
@@ -164013,10 +164043,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164013
164043
  }
164014
164044
  }
164015
164045
  }
164016
- const identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, signatureParamPos);
164046
+ const identifierInfo = checker.getParameterIdentifierInfoAtPosition(signature, signatureParamPos);
164017
164047
  signatureParamPos = signatureParamPos + (spreadArgs || 1);
164018
- if (identifierNameInfo) {
164019
- const [parameterName, isFirstVariadicArgument] = identifierNameInfo;
164048
+ if (identifierInfo) {
164049
+ const { parameter, parameterName, isRestParameter: isFirstVariadicArgument } = identifierInfo;
164020
164050
  const isParameterNameNotSameAsArgument = preferences.includeInlayParameterNameHintsWhenArgumentMatchesName || !identifierOrAccessExpressionPostfixMatchesParameterName(arg, parameterName);
164021
164051
  if (!isParameterNameNotSameAsArgument && !isFirstVariadicArgument) {
164022
164052
  continue;
@@ -164025,7 +164055,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164025
164055
  if (leadingCommentsContainsParameterName(arg, name)) {
164026
164056
  continue;
164027
164057
  }
164028
- addParameterHints(name, originalArg.getStart(), isFirstVariadicArgument);
164058
+ addParameterHints(name, parameter, originalArg.getStart(), isFirstVariadicArgument, sourceFile);
164029
164059
  }
164030
164060
  }
164031
164061
  }
@@ -164131,12 +164161,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164131
164161
  }
164132
164162
  return printTypeInSingleLine(signatureParamType);
164133
164163
  }
164134
- function truncation(text, maxLength2) {
164135
- if (text.length > maxLength2) {
164136
- return text.substr(0, maxLength2 - "...".length) + "...";
164137
- }
164138
- return text;
164139
- }
164140
164164
  function printTypeInSingleLine(type) {
164141
164165
  const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */;
164142
164166
  const printer = createPrinterWithRemoveComments();
@@ -164167,13 +164191,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164167
164191
  }
164168
164192
  return true;
164169
164193
  }
164194
+ function getNodeDisplayPart(text, node, sourceFile) {
164195
+ return {
164196
+ text,
164197
+ span: createTextSpanFromNode(node, sourceFile),
164198
+ file: sourceFile.fileName
164199
+ };
164200
+ }
164170
164201
  }
164171
- var maxHintsLength, leadingParameterNameCommentRegexFactory;
164202
+ var maxTypeHintLength, leadingParameterNameCommentRegexFactory;
164172
164203
  var init_inlayHints = __esm({
164173
164204
  "src/services/inlayHints.ts"() {
164174
164205
  "use strict";
164175
164206
  init_ts4();
164176
- maxHintsLength = 30;
164207
+ maxTypeHintLength = 30;
164177
164208
  leadingParameterNameCommentRegexFactory = (name) => {
164178
164209
  return new RegExp(`^\\s?/\\*\\*?\\s?${name}\\s?\\*\\/\\s?$`);
164179
164210
  };
@@ -166675,7 +166706,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166675
166706
  }
166676
166707
  return modifiers.size > 0 ? arrayFrom(modifiers.values()).join(",") : "" /* none */;
166677
166708
  }
166678
- function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning = getMeaningFromLocation(location), alias) {
166709
+ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symbol, sourceFile, enclosingDeclaration, location, type, semanticMeaning, alias) {
166679
166710
  var _a;
166680
166711
  const displayParts = [];
166681
166712
  let documentation = [];
@@ -166684,7 +166715,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166684
166715
  let symbolKind = semanticMeaning & 1 /* Value */ ? getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) : "" /* unknown */;
166685
166716
  let hasAddedSymbolInfo = false;
166686
166717
  const isThisExpression = location.kind === 110 /* ThisKeyword */ && isInExpressionContext(location) || isThisInTypeQuery(location);
166687
- let type;
166688
166718
  let documentationFromAlias;
166689
166719
  let tagsFromAlias;
166690
166720
  let hasMultipleSignatures = false;
@@ -166713,7 +166743,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166713
166743
  }
166714
166744
  }
166715
166745
  let signature;
166716
- type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location);
166746
+ type ?? (type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location));
166717
166747
  if (location.parent && location.parent.kind === 211 /* PropertyAccessExpression */) {
166718
166748
  const right = location.parent.name;
166719
166749
  if (right === location || right && right.getFullWidth() === 0) {
@@ -166928,12 +166958,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166928
166958
  if (declarationName && !hasAddedSymbolInfo) {
166929
166959
  const isExternalModuleDeclaration = isModuleWithStringLiteralName(resolvedNode) && hasSyntacticModifier(resolvedNode, 2 /* Ambient */);
166930
166960
  const shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration;
166931
- const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKind(
166961
+ const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
166932
166962
  typeChecker,
166933
166963
  resolvedSymbol,
166934
166964
  getSourceFileOfNode(resolvedNode),
166935
166965
  resolvedNode,
166936
166966
  declarationName,
166967
+ type,
166937
166968
  semanticMeaning,
166938
166969
  shouldUseAliasName ? symbol : resolvedSymbol
166939
166970
  );
@@ -167188,6 +167219,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
167188
167219
  addRange(displayParts, typeParameterParts);
167189
167220
  }
167190
167221
  }
167222
+ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning = getMeaningFromLocation(location), alias) {
167223
+ return getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
167224
+ typeChecker,
167225
+ symbol,
167226
+ sourceFile,
167227
+ enclosingDeclaration,
167228
+ location,
167229
+ /*type*/
167230
+ void 0,
167231
+ semanticMeaning,
167232
+ alias
167233
+ );
167234
+ }
167191
167235
  function isLocalVariableOrFunction(symbol) {
167192
167236
  if (symbol.parent) {
167193
167237
  return false;
@@ -172503,6 +172547,7 @@ ${options.prefix}` : "\n" : options.prefix
172503
172547
  getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression,
172504
172548
  getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode,
172505
172549
  getPropertyNameForUniqueESSymbol: () => getPropertyNameForUniqueESSymbol,
172550
+ getPropertyNameFromType: () => getPropertyNameFromType,
172506
172551
  getPropertyNameOfBindingOrAssignmentElement: () => getPropertyNameOfBindingOrAssignmentElement,
172507
172552
  getPropertySymbolFromBindingElement: () => getPropertySymbolFromBindingElement,
172508
172553
  getPropertySymbolsFromContextualType: () => getPropertySymbolsFromContextualType,
@@ -173335,6 +173380,7 @@ ${options.prefix}` : "\n" : options.prefix
173335
173380
  isTypeQueryNode: () => isTypeQueryNode,
173336
173381
  isTypeReferenceNode: () => isTypeReferenceNode,
173337
173382
  isTypeReferenceType: () => isTypeReferenceType,
173383
+ isTypeUsableAsPropertyName: () => isTypeUsableAsPropertyName,
173338
173384
  isUMDExportSymbol: () => isUMDExportSymbol,
173339
173385
  isUnaryExpression: () => isUnaryExpression,
173340
173386
  isUnaryExpressionWithWrite: () => isUnaryExpressionWithWrite,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.2";
57
- var version = `${versionMajorMinor}.0-dev.20230720`;
57
+ var version = `${versionMajorMinor}.0-dev.20230721`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -22618,10 +22618,14 @@ var Parser;
22618
22618
  case 124 /* ProtectedKeyword */:
22619
22619
  case 125 /* PublicKeyword */:
22620
22620
  case 148 /* ReadonlyKeyword */:
22621
+ const previousToken = token();
22621
22622
  nextToken();
22622
22623
  if (scanner.hasPrecedingLineBreak()) {
22623
22624
  return false;
22624
22625
  }
22626
+ if (previousToken === 138 /* DeclareKeyword */ && token() === 156 /* TypeKeyword */) {
22627
+ return true;
22628
+ }
22625
22629
  continue;
22626
22630
  case 162 /* GlobalKeyword */:
22627
22631
  nextToken();
@@ -22986,14 +22990,14 @@ var Parser;
22986
22990
  function parseObjectBindingPattern() {
22987
22991
  const pos = getNodePos();
22988
22992
  parseExpected(19 /* OpenBraceToken */);
22989
- const elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement);
22993
+ const elements = allowInAnd(() => parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement));
22990
22994
  parseExpected(20 /* CloseBraceToken */);
22991
22995
  return finishNode(factory2.createObjectBindingPattern(elements), pos);
22992
22996
  }
22993
22997
  function parseArrayBindingPattern() {
22994
22998
  const pos = getNodePos();
22995
22999
  parseExpected(23 /* OpenBracketToken */);
22996
- const elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement);
23000
+ const elements = allowInAnd(() => parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement));
22997
23001
  parseExpected(24 /* CloseBracketToken */);
22998
23002
  return finishNode(factory2.createArrayBindingPattern(elements), pos);
22999
23003
  }
@@ -23511,6 +23515,9 @@ var Parser;
23511
23515
  }
23512
23516
  function parseTypeAliasDeclaration(pos, hasJSDoc, modifiers) {
23513
23517
  parseExpected(156 /* TypeKeyword */);
23518
+ if (scanner.hasPrecedingLineBreak()) {
23519
+ parseErrorAtCurrentToken(Diagnostics.Line_break_not_permitted_here);
23520
+ }
23514
23521
  const name = parseIdentifier();
23515
23522
  const typeParameters = parseTypeParameters();
23516
23523
  parseExpected(64 /* EqualsToken */);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.2.0-dev.20230720",
5
+ "version": "5.2.0-dev.20230721",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "20.1.0",
114
114
  "npm": "8.19.4"
115
115
  },
116
- "gitHead": "97ef321fa04b95e00ec0a3ff18d40457dd0e8c67"
116
+ "gitHead": "61bf78f3c2c8fd4d92e9c56109519edc2e38185f"
117
117
  }