typescript 5.9.0-dev.20250630 → 5.9.0-dev.20250702

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
@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
2285
2285
 
2286
2286
  // src/compiler/corePublic.ts
2287
2287
  var versionMajorMinor = "5.9";
2288
- var version = `${versionMajorMinor}.0-dev.20250630`;
2288
+ var version = `${versionMajorMinor}.0-dev.20250702`;
2289
2289
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2290
2290
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2291
2291
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10072,7 +10072,7 @@ var Diagnostics = {
10072
10072
  Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."),
10073
10073
  Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."),
10074
10074
  _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, 1 /* Error */, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),
10075
- Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, 1 /* Error */, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."),
10075
+ Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0: diag(2725, 1 /* Error */, "Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 and above with module {0}."),
10076
10076
  Cannot_find_lib_definition_for_0: diag(2726, 1 /* Error */, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."),
10077
10077
  Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, 1 /* Error */, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"),
10078
10078
  _0_is_declared_here: diag(2728, 3 /* Message */, "_0_is_declared_here_2728", "'{0}' is declared here."),
@@ -19780,8 +19780,8 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => {
19780
19780
  OperatorPrecedence2[OperatorPrecedence2["Yield"] = 2] = "Yield";
19781
19781
  OperatorPrecedence2[OperatorPrecedence2["Assignment"] = 3] = "Assignment";
19782
19782
  OperatorPrecedence2[OperatorPrecedence2["Conditional"] = 4] = "Conditional";
19783
- OperatorPrecedence2[OperatorPrecedence2["Coalesce"] = 4 /* Conditional */] = "Coalesce";
19784
19783
  OperatorPrecedence2[OperatorPrecedence2["LogicalOR"] = 5] = "LogicalOR";
19784
+ OperatorPrecedence2[OperatorPrecedence2["Coalesce"] = 5 /* LogicalOR */] = "Coalesce";
19785
19785
  OperatorPrecedence2[OperatorPrecedence2["LogicalAND"] = 6] = "LogicalAND";
19786
19786
  OperatorPrecedence2[OperatorPrecedence2["BitwiseOR"] = 7] = "BitwiseOR";
19787
19787
  OperatorPrecedence2[OperatorPrecedence2["BitwiseXOR"] = 8] = "BitwiseXOR";
@@ -19890,7 +19890,7 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
19890
19890
  function getBinaryOperatorPrecedence(kind) {
19891
19891
  switch (kind) {
19892
19892
  case 61 /* QuestionQuestionToken */:
19893
- return 4 /* Coalesce */;
19893
+ return 5 /* Coalesce */;
19894
19894
  case 57 /* BarBarToken */:
19895
19895
  return 5 /* LogicalOR */;
19896
19896
  case 56 /* AmpersandAmpersandToken */:
@@ -22305,7 +22305,7 @@ function escapeRegExpCharacter(match) {
22305
22305
  }
22306
22306
  var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
22307
22307
  var commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
22308
- var implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`;
22308
+ var implicitExcludePathRegexPattern = `(?!(?:${commonPackageFolders.join("|")})(?:/|$))`;
22309
22309
  var filesMatcher = {
22310
22310
  /**
22311
22311
  * Matches any single directory segment unless it is the last segment and a .min.js file
@@ -22313,12 +22313,12 @@ var filesMatcher = {
22313
22313
  * [^./] # matches everything up to the first . character (excluding directory separators)
22314
22314
  * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension
22315
22315
  */
22316
- singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*",
22316
+ singleAsteriskRegexFragment: "(?:[^./]|(?:\\.(?!min\\.js$))?)*",
22317
22317
  /**
22318
22318
  * Regex for the ** wildcard. Matches any number of subdirectories. When used for including
22319
22319
  * files or directories, does not match subdirectories that start with a . character
22320
22320
  */
22321
- doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
22321
+ doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
22322
22322
  replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment)
22323
22323
  };
22324
22324
  var directoriesMatcher = {
@@ -22327,12 +22327,12 @@ var directoriesMatcher = {
22327
22327
  * Regex for the ** wildcard. Matches any number of subdirectories. When used for including
22328
22328
  * files or directories, does not match subdirectories that start with a . character
22329
22329
  */
22330
- doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
22330
+ doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
22331
22331
  replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment)
22332
22332
  };
22333
22333
  var excludeMatcher = {
22334
22334
  singleAsteriskRegexFragment: "[^/]*",
22335
- doubleAsteriskRegexFragment: "(/.+?)?",
22335
+ doubleAsteriskRegexFragment: "(?:/.+?)?",
22336
22336
  replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment)
22337
22337
  };
22338
22338
  var wildcardMatchers = {
@@ -22345,9 +22345,9 @@ function getRegularExpressionForWildcard(specs, basePath, usage) {
22345
22345
  if (!patterns || !patterns.length) {
22346
22346
  return void 0;
22347
22347
  }
22348
- const pattern = patterns.map((pattern2) => `(${pattern2})`).join("|");
22349
- const terminator = usage === "exclude" ? "($|/)" : "$";
22350
- return `^(${pattern})${terminator}`;
22348
+ const pattern = patterns.map((pattern2) => `(?:${pattern2})`).join("|");
22349
+ const terminator = usage === "exclude" ? "(?:$|/)" : "$";
22350
+ return `^(?:${pattern})${terminator}`;
22351
22351
  }
22352
22352
  function getRegularExpressionsForWildcards(specs, basePath, usage) {
22353
22353
  if (specs === void 0 || specs.length === 0) {
@@ -22360,7 +22360,7 @@ function isImplicitGlob(lastPathComponent) {
22360
22360
  }
22361
22361
  function getPatternFromSpec(spec, basePath, usage) {
22362
22362
  const pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
22363
- return pattern && `^(${pattern})${usage === "exclude" ? "($|/)" : "$"}`;
22363
+ return pattern && `^(?:${pattern})${usage === "exclude" ? "(?:$|/)" : "$"}`;
22364
22364
  }
22365
22365
  function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 } = wildcardMatchers[usage]) {
22366
22366
  let subpattern = "";
@@ -22380,7 +22380,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm
22380
22380
  subpattern += doubleAsteriskRegexFragment;
22381
22381
  } else {
22382
22382
  if (usage === "directories") {
22383
- subpattern += "(";
22383
+ subpattern += "(?:";
22384
22384
  optionalCount++;
22385
22385
  }
22386
22386
  if (hasWrittenComponent) {
@@ -22389,7 +22389,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm
22389
22389
  if (usage !== "exclude") {
22390
22390
  let componentPattern = "";
22391
22391
  if (component.charCodeAt(0) === 42 /* asterisk */) {
22392
- componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?";
22392
+ componentPattern += "(?:[^./]" + singleAsteriskRegexFragment + ")?";
22393
22393
  component = component.substr(1);
22394
22394
  } else if (component.charCodeAt(0) === 63 /* question */) {
22395
22395
  componentPattern += "[^./]";
@@ -36237,10 +36237,13 @@ var Parser;
36237
36237
  if (token() !== 27 /* SemicolonToken */ && token() !== 100 /* FunctionKeyword */ && token() !== 86 /* ClassKeyword */ && isStartOfStatement() && !isStartOfExpressionStatement()) {
36238
36238
  return parseFunctionBlock(16 /* IgnoreMissingOpenBrace */ | (isAsync ? 2 /* Await */ : 0 /* None */));
36239
36239
  }
36240
+ const savedYieldContext = inYieldContext();
36241
+ setYieldContext(false);
36240
36242
  const savedTopLevel = topLevel;
36241
36243
  topLevel = false;
36242
36244
  const node = isAsync ? doInAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)) : doOutsideOfAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction));
36243
36245
  topLevel = savedTopLevel;
36246
+ setYieldContext(savedYieldContext);
36244
36247
  return node;
36245
36248
  }
36246
36249
  function parseConditionalExpressionRest(leftOperand, pos, allowReturnTypeInArrowFunction) {
@@ -51835,6 +51838,7 @@ function createTypeChecker(host) {
51835
51838
  }
51836
51839
  };
51837
51840
  var anyIterationTypes = createIterationTypes(anyType, anyType, anyType);
51841
+ var silentNeverIterationTypes = createIterationTypes(silentNeverType, silentNeverType, silentNeverType);
51838
51842
  var asyncIterationTypesResolver = {
51839
51843
  iterableCacheKey: "iterationTypesOfAsyncIterable",
51840
51844
  iteratorCacheKey: "iterationTypesOfAsyncIterator",
@@ -55048,7 +55052,14 @@ function createTypeChecker(host) {
55048
55052
  if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((_a = declaration.parent) == null ? void 0 : _a.parent) && isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) == null ? void 0 : _b.parent) && isVariableStatement(declaration.parent.parent.parent.parent) && !hasSyntacticModifier(declaration.parent.parent.parent.parent, 32 /* Export */) && declaration.parent.parent.parent.parent.parent && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) {
55049
55053
  return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);
55050
55054
  } else if (symbol.flags & 2 /* BlockScopedVariable */) {
55051
- const variableStatement = findAncestor(declaration, isVariableStatement);
55055
+ const rootDeclaration = walkUpBindingElementsAndPatterns(declaration);
55056
+ if (rootDeclaration.kind === 170 /* Parameter */) {
55057
+ return false;
55058
+ }
55059
+ const variableStatement = rootDeclaration.parent.parent;
55060
+ if (variableStatement.kind !== 244 /* VariableStatement */) {
55061
+ return false;
55062
+ }
55052
55063
  if (hasSyntacticModifier(variableStatement, 32 /* Export */)) {
55053
55064
  return true;
55054
55065
  }
@@ -56742,27 +56753,77 @@ function createTypeChecker(host) {
56742
56753
  context.approximateLength += symbolName(propertySymbol).length + 1;
56743
56754
  if (propertySymbol.flags & 98304 /* Accessor */) {
56744
56755
  const writeType = getWriteTypeOfSymbol(propertySymbol);
56745
- if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
56756
+ if (!isErrorType(propertyType) && !isErrorType(writeType)) {
56746
56757
  const symbolMapper = getSymbolLinks(propertySymbol).mapper;
56747
- const getterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* GetAccessor */);
56748
- const getterSignature = getSignatureFromDeclaration(getterDeclaration);
56749
- typeElements.push(
56750
- setCommentRange2(
56751
- context,
56752
- signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(getterSignature, symbolMapper) : getterSignature, 178 /* GetAccessor */, context, { name: propertyName }),
56753
- getterDeclaration
56754
- )
56755
- );
56756
- const setterDeclaration = getDeclarationOfKind(propertySymbol, 179 /* SetAccessor */);
56757
- const setterSignature = getSignatureFromDeclaration(setterDeclaration);
56758
- typeElements.push(
56759
- setCommentRange2(
56760
- context,
56761
- signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(setterSignature, symbolMapper) : setterSignature, 179 /* SetAccessor */, context, { name: propertyName }),
56762
- setterDeclaration
56763
- )
56764
- );
56765
- return;
56758
+ const propDeclaration = getDeclarationOfKind(propertySymbol, 173 /* PropertyDeclaration */);
56759
+ if (propertyType !== writeType || propertySymbol.parent.flags & 32 /* Class */ && !propDeclaration) {
56760
+ const getterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* GetAccessor */);
56761
+ if (getterDeclaration) {
56762
+ const getterSignature = getSignatureFromDeclaration(getterDeclaration);
56763
+ typeElements.push(
56764
+ setCommentRange2(
56765
+ context,
56766
+ signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(getterSignature, symbolMapper) : getterSignature, 178 /* GetAccessor */, context, { name: propertyName }),
56767
+ getterDeclaration
56768
+ )
56769
+ );
56770
+ }
56771
+ const setterDeclaration = getDeclarationOfKind(propertySymbol, 179 /* SetAccessor */);
56772
+ if (setterDeclaration) {
56773
+ const setterSignature = getSignatureFromDeclaration(setterDeclaration);
56774
+ typeElements.push(
56775
+ setCommentRange2(
56776
+ context,
56777
+ signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(setterSignature, symbolMapper) : setterSignature, 179 /* SetAccessor */, context, { name: propertyName }),
56778
+ setterDeclaration
56779
+ )
56780
+ );
56781
+ }
56782
+ return;
56783
+ }
56784
+ if (propertySymbol.parent.flags & 32 /* Class */ && propDeclaration && find(propDeclaration.modifiers, isAccessorModifier)) {
56785
+ const fakeGetterSignature = createSignature(
56786
+ /*declaration*/
56787
+ void 0,
56788
+ /*typeParameters*/
56789
+ void 0,
56790
+ /*thisParameter*/
56791
+ void 0,
56792
+ emptyArray,
56793
+ propertyType,
56794
+ /*resolvedTypePredicate*/
56795
+ void 0,
56796
+ 0,
56797
+ 0 /* None */
56798
+ );
56799
+ typeElements.push(
56800
+ setCommentRange2(
56801
+ context,
56802
+ signatureToSignatureDeclarationHelper(fakeGetterSignature, 178 /* GetAccessor */, context, { name: propertyName }),
56803
+ propDeclaration
56804
+ )
56805
+ );
56806
+ const setterParam = createSymbol(1 /* FunctionScopedVariable */, "arg");
56807
+ setterParam.links.type = writeType;
56808
+ const fakeSetterSignature = createSignature(
56809
+ /*declaration*/
56810
+ void 0,
56811
+ /*typeParameters*/
56812
+ void 0,
56813
+ /*thisParameter*/
56814
+ void 0,
56815
+ [setterParam],
56816
+ voidType,
56817
+ /*resolvedTypePredicate*/
56818
+ void 0,
56819
+ 0,
56820
+ 0 /* None */
56821
+ );
56822
+ typeElements.push(
56823
+ signatureToSignatureDeclarationHelper(fakeSetterSignature, 179 /* SetAccessor */, context, { name: propertyName })
56824
+ );
56825
+ return;
56826
+ }
56766
56827
  }
56767
56828
  }
56768
56829
  const optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0;
@@ -61353,11 +61414,14 @@ function createTypeChecker(host) {
61353
61414
  }
61354
61415
  function getWriteTypeOfSymbol(symbol) {
61355
61416
  const checkFlags = getCheckFlags(symbol);
61356
- if (symbol.flags & 4 /* Property */) {
61357
- return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
61417
+ if (checkFlags & 2 /* SyntheticProperty */) {
61418
+ return checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
61358
61419
  // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
61359
61420
  symbol.links.writeType || symbol.links.type
61360
- ) : removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */));
61421
+ );
61422
+ }
61423
+ if (symbol.flags & 4 /* Property */) {
61424
+ return removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */));
61361
61425
  }
61362
61426
  if (symbol.flags & 98304 /* Accessor */) {
61363
61427
  return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
@@ -63513,6 +63577,7 @@ function createTypeChecker(host) {
63513
63577
  }
63514
63578
  function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) {
63515
63579
  var _a, _b, _c;
63580
+ let propFlags = 0 /* None */;
63516
63581
  let singleProp;
63517
63582
  let propSet;
63518
63583
  let indexTypes;
@@ -63537,6 +63602,7 @@ function createTypeChecker(host) {
63537
63602
  }
63538
63603
  if (!singleProp) {
63539
63604
  singleProp = prop;
63605
+ propFlags = prop.flags & 98304 /* Accessor */ || 4 /* Property */;
63540
63606
  } else if (prop !== singleProp) {
63541
63607
  const isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp);
63542
63608
  if (isInstantiation && compareProperties2(singleProp, prop, (a, b) => a === b ? -1 /* True */ : 0 /* False */) === -1 /* True */) {
@@ -63551,6 +63617,9 @@ function createTypeChecker(host) {
63551
63617
  propSet.set(id, prop);
63552
63618
  }
63553
63619
  }
63620
+ if (propFlags & 98304 /* Accessor */ && (prop.flags & 98304 /* Accessor */) !== (propFlags & 98304 /* Accessor */)) {
63621
+ propFlags = propFlags & ~98304 /* Accessor */ | 4 /* Property */;
63622
+ }
63554
63623
  }
63555
63624
  if (isUnion && isReadonlySymbol(prop)) {
63556
63625
  checkFlags |= 8 /* Readonly */;
@@ -63564,6 +63633,7 @@ function createTypeChecker(host) {
63564
63633
  } else if (isUnion) {
63565
63634
  const indexInfo = !isLateBoundName(name) && getApplicableIndexInfoForName(type, name);
63566
63635
  if (indexInfo) {
63636
+ propFlags = propFlags & ~98304 /* Accessor */ | 4 /* Property */;
63567
63637
  checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
63568
63638
  indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
63569
63639
  } else if (isObjectLiteralType2(type) && !(getObjectFlags(type) & 2097152 /* ContainsSpread */)) {
@@ -63627,7 +63697,7 @@ function createTypeChecker(host) {
63627
63697
  propTypes.push(type);
63628
63698
  }
63629
63699
  addRange(propTypes, indexTypes);
63630
- const result = createSymbol(4 /* Property */ | (optionalFlag ?? 0), name, syntheticFlag | checkFlags);
63700
+ const result = createSymbol(propFlags | (optionalFlag ?? 0), name, syntheticFlag | checkFlags);
63631
63701
  result.links.containingType = containingType;
63632
63702
  if (!hasNonUniformValueDeclaration && firstValueDeclaration) {
63633
63703
  result.valueDeclaration = firstValueDeclaration;
@@ -83260,6 +83330,9 @@ function createTypeChecker(host) {
83260
83330
  return { yieldTypes, nextTypes };
83261
83331
  }
83262
83332
  function getYieldedTypeOfYieldExpression(node, expressionType, sentType, isAsync) {
83333
+ if (expressionType === silentNeverType) {
83334
+ return silentNeverType;
83335
+ }
83263
83336
  const errorNode = node.expression || node;
83264
83337
  const yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync ? 19 /* AsyncYieldStar */ : 17 /* YieldStar */, expressionType, sentType, errorNode) : expressionType;
83265
83338
  return !isAsync ? yieldedType : getAwaitedType(
@@ -84293,17 +84366,27 @@ function createTypeChecker(host) {
84293
84366
  }
84294
84367
  }
84295
84368
  function checkNullishCoalesceOperands(node) {
84296
- const { left, operatorToken, right } = node;
84297
- if (operatorToken.kind === 61 /* QuestionQuestionToken */) {
84298
- if (isBinaryExpression(left) && (left.operatorToken.kind === 57 /* BarBarToken */ || left.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
84299
- grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(left.operatorToken.kind), tokenToString(operatorToken.kind));
84369
+ if (node.operatorToken.kind !== 61 /* QuestionQuestionToken */) {
84370
+ return;
84371
+ }
84372
+ if (isBinaryExpression(node.parent)) {
84373
+ const { left, operatorToken } = node.parent;
84374
+ if (isBinaryExpression(left) && operatorToken.kind === 57 /* BarBarToken */) {
84375
+ grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(61 /* QuestionQuestionToken */), tokenToString(operatorToken.kind));
84376
+ }
84377
+ } else if (isBinaryExpression(node.left)) {
84378
+ const { operatorToken } = node.left;
84379
+ if (operatorToken.kind === 57 /* BarBarToken */ || operatorToken.kind === 56 /* AmpersandAmpersandToken */) {
84380
+ grammarErrorOnNode(node.left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(operatorToken.kind), tokenToString(61 /* QuestionQuestionToken */));
84300
84381
  }
84301
- if (isBinaryExpression(right) && (right.operatorToken.kind === 57 /* BarBarToken */ || right.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
84302
- grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind));
84382
+ } else if (isBinaryExpression(node.right)) {
84383
+ const { operatorToken } = node.right;
84384
+ if (operatorToken.kind === 56 /* AmpersandAmpersandToken */) {
84385
+ grammarErrorOnNode(node.right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(61 /* QuestionQuestionToken */), tokenToString(operatorToken.kind));
84303
84386
  }
84304
- checkNullishCoalesceOperandLeft(node);
84305
- checkNullishCoalesceOperandRight(node);
84306
84387
  }
84388
+ checkNullishCoalesceOperandLeft(node);
84389
+ checkNullishCoalesceOperandRight(node);
84307
84390
  }
84308
84391
  function checkNullishCoalesceOperandLeft(node) {
84309
84392
  const leftTarget = skipOuterExpressions(node.left, 63 /* All */);
@@ -88342,6 +88425,9 @@ function createTypeChecker(host) {
88342
88425
  }
88343
88426
  function getIterationTypesOfIterable(type, use, errorNode) {
88344
88427
  var _a, _b;
88428
+ if (type === silentNeverType) {
88429
+ return silentNeverIterationTypes;
88430
+ }
88345
88431
  if (isTypeAny(type)) {
88346
88432
  return anyIterationTypes;
88347
88433
  }
@@ -89067,7 +89153,7 @@ function createTypeChecker(host) {
89067
89153
  }
89068
89154
  function checkClassNameCollisionWithObject(name) {
89069
89155
  if (languageVersion >= 1 /* ES5 */ && name.escapedText === "Object" && host.getEmitModuleFormatOfFile(getSourceFileOfNode(name)) < 5 /* ES2015 */) {
89070
- error2(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]);
89156
+ error2(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0, ModuleKind[moduleKind]);
89071
89157
  }
89072
89158
  }
89073
89159
  function checkUnmatchedJSDocParameters(node) {
@@ -133440,7 +133526,7 @@ function getMatchedIncludeSpec(program, fileName) {
133440
133526
  const index = findIndex((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => {
133441
133527
  if (isJsonFile && !endsWith(includeSpec, ".json" /* Json */)) return false;
133442
133528
  const pattern = getPatternFromSpec(includeSpec, basePath, "files");
133443
- return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames2).test(fileName);
133529
+ return !!pattern && getRegexFromPattern(`(?:${pattern})$`, useCaseSensitiveFileNames2).test(fileName);
133444
133530
  });
133445
133531
  return index !== -1 ? configFile.configFileSpecs.validatedIncludeSpecsBeforeSubstitution[index] : void 0;
133446
133532
  }
@@ -138432,7 +138518,8 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
138432
138518
  function ensureParameter(p, context) {
138433
138519
  return factory.updateParameterDeclaration(
138434
138520
  p,
138435
- [],
138521
+ /*modifiers*/
138522
+ void 0,
138436
138523
  reuseNode(context, p.dotDotDotToken),
138437
138524
  resolver.serializeNameOfParameter(context, p),
138438
138525
  resolver.isOptionalParameter(p) ? factory.createToken(58 /* QuestionToken */) : void 0,
@@ -153973,6 +154060,7 @@ function getContainingObjectLiteralElementWorker(node) {
153973
154060
  }
153974
154061
  // falls through
153975
154062
  case 80 /* Identifier */:
154063
+ case 296 /* JsxNamespacedName */:
153976
154064
  return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 211 /* ObjectLiteralExpression */ || node.parent.parent.kind === 293 /* JsxAttributes */) && node.parent.name === node ? node.parent : void 0;
153977
154065
  }
153978
154066
  return void 0;
@@ -155026,7 +155114,6 @@ __export(ts_codefix_exports, {
155026
155114
  generateAccessorFromProperty: () => generateAccessorFromProperty,
155027
155115
  getAccessorConvertiblePropertyAtPosition: () => getAccessorConvertiblePropertyAtPosition,
155028
155116
  getAllFixes: () => getAllFixes,
155029
- getAllSupers: () => getAllSupers,
155030
155117
  getFixes: () => getFixes,
155031
155118
  getImportCompletionAction: () => getImportCompletionAction,
155032
155119
  getImportKind: () => getImportKind,
@@ -161248,6 +161335,20 @@ function findScope(node) {
161248
161335
  }
161249
161336
  return getSourceFileOfNode(node);
161250
161337
  }
161338
+ function getAllSupers(decl, checker) {
161339
+ const res = [];
161340
+ while (decl) {
161341
+ const superElement = getClassExtendsHeritageElement(decl);
161342
+ const superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression);
161343
+ if (!superSymbol) break;
161344
+ const symbol = superSymbol.flags & 2097152 /* Alias */ ? checker.getAliasedSymbol(superSymbol) : superSymbol;
161345
+ const superDecl = symbol.declarations && find(symbol.declarations, isClassLike);
161346
+ if (!superDecl) break;
161347
+ res.push(superDecl);
161348
+ decl = superDecl;
161349
+ }
161350
+ return res;
161351
+ }
161251
161352
 
161252
161353
  // src/services/codefixes/fixAddMissingNewOperator.ts
161253
161354
  var fixId25 = "addMissingNewOperator";
@@ -163668,14 +163769,20 @@ function doChange32(file, start, length2, code, context) {
163668
163769
  } else if (code === Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code) {
163669
163770
  const checker = context.program.getTypeChecker();
163670
163771
  const node = getTokenAtPosition(file, start).parent;
163772
+ if (isComputedPropertyName(node)) {
163773
+ return;
163774
+ }
163671
163775
  Debug.assert(isAccessor(node), "error span of fixPropertyOverrideAccessor should only be on an accessor");
163672
163776
  const containingClass = node.parent;
163673
163777
  Debug.assert(isClassLike(containingClass), "erroneous accessors should only be inside classes");
163674
- const base = singleOrUndefined(getAllSupers(containingClass, checker));
163675
- if (!base) return [];
163676
- const name = unescapeLeadingUnderscores(getTextOfPropertyName(node.name));
163677
- const baseProp = checker.getPropertyOfType(checker.getTypeAtLocation(base), name);
163678
- if (!baseProp || !baseProp.valueDeclaration) return [];
163778
+ const baseTypeNode = getEffectiveBaseTypeNode(containingClass);
163779
+ if (!baseTypeNode) return;
163780
+ const expression = skipParentheses(baseTypeNode.expression);
163781
+ const base = isClassExpression(expression) ? expression.symbol : checker.getSymbolAtLocation(expression);
163782
+ if (!base) return;
163783
+ const baseType = checker.getDeclaredTypeOfSymbol(base);
163784
+ const baseProp = checker.getPropertyOfType(baseType, unescapeLeadingUnderscores(getTextOfPropertyName(node.name)));
163785
+ if (!baseProp || !baseProp.valueDeclaration) return;
163679
163786
  startPosition = baseProp.valueDeclaration.pos;
163680
163787
  endPosition = baseProp.valueDeclaration.end;
163681
163788
  file = getSourceFileOfNode(baseProp.valueDeclaration);
@@ -165742,20 +165849,6 @@ function getDeclarationType(declaration, program) {
165742
165849
  }
165743
165850
  return typeNode;
165744
165851
  }
165745
- function getAllSupers(decl, checker) {
165746
- const res = [];
165747
- while (decl) {
165748
- const superElement = getClassExtendsHeritageElement(decl);
165749
- const superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression);
165750
- if (!superSymbol) break;
165751
- const symbol = superSymbol.flags & 2097152 /* Alias */ ? checker.getAliasedSymbol(superSymbol) : superSymbol;
165752
- const superDecl = symbol.declarations && find(symbol.declarations, isClassLike);
165753
- if (!superDecl) break;
165754
- res.push(superDecl);
165755
- decl = superDecl;
165756
- }
165757
- return res;
165758
- }
165759
165852
 
165760
165853
  // src/services/codefixes/fixInvalidImportSyntax.ts
165761
165854
  var fixName5 = "invalidImportSyntax";
@@ -174356,10 +174449,23 @@ function getDefinitionFromOverriddenMember(typeChecker, node) {
174356
174449
  const expression = skipParentheses(baseTypeNode.expression);
174357
174450
  const base = isClassExpression(expression) ? expression.symbol : typeChecker.getSymbolAtLocation(expression);
174358
174451
  if (!base) return;
174359
- const name = unescapeLeadingUnderscores(getTextOfPropertyName(classElement.name));
174360
- const symbol = hasStaticModifier(classElement) ? typeChecker.getPropertyOfType(typeChecker.getTypeOfSymbol(base), name) : typeChecker.getPropertyOfType(typeChecker.getDeclaredTypeOfSymbol(base), name);
174361
- if (!symbol) return;
174362
- return getDefinitionFromSymbol(typeChecker, symbol, node);
174452
+ const baseType = hasStaticModifier(classElement) ? typeChecker.getTypeOfSymbol(base) : typeChecker.getDeclaredTypeOfSymbol(base);
174453
+ let baseProp;
174454
+ if (isComputedPropertyName(classElement.name)) {
174455
+ const prop = typeChecker.getSymbolAtLocation(classElement.name);
174456
+ if (!prop) {
174457
+ return;
174458
+ }
174459
+ if (isKnownSymbol(prop)) {
174460
+ baseProp = find(typeChecker.getPropertiesOfType(baseType), (s) => s.escapedName === prop.escapedName);
174461
+ } else {
174462
+ baseProp = typeChecker.getPropertyOfType(baseType, unescapeLeadingUnderscores(prop.escapedName));
174463
+ }
174464
+ } else {
174465
+ baseProp = typeChecker.getPropertyOfType(baseType, unescapeLeadingUnderscores(getTextOfPropertyName(classElement.name)));
174466
+ }
174467
+ if (!baseProp) return;
174468
+ return getDefinitionFromSymbol(typeChecker, baseProp, node);
174363
174469
  }
174364
174470
  function getReferenceAtPosition(sourceFile, position, program) {
174365
174471
  var _a, _b;
@@ -175396,6 +175502,15 @@ function provideInlayHints(context) {
175396
175502
  visitForDisplayParts(node2.type);
175397
175503
  }
175398
175504
  break;
175505
+ case 181 /* ConstructSignature */:
175506
+ Debug.assertNode(node2, isConstructSignatureDeclaration);
175507
+ parts.push({ text: "new " });
175508
+ visitParametersAndTypeParameters(node2);
175509
+ if (node2.type) {
175510
+ parts.push({ text: ": " });
175511
+ visitForDisplayParts(node2.type);
175512
+ }
175513
+ break;
175399
175514
  case 208 /* ArrayBindingPattern */:
175400
175515
  Debug.assertNode(node2, isArrayBindingPattern);
175401
175516
  parts.push({ text: "[" });
@@ -175447,6 +175562,12 @@ function provideInlayHints(context) {
175447
175562
  Debug.assertNode(node2, isThisTypeNode);
175448
175563
  parts.push({ text: "this" });
175449
175564
  break;
175565
+ case 168 /* ComputedPropertyName */:
175566
+ Debug.assertNode(node2, isComputedPropertyName);
175567
+ parts.push({ text: "[" });
175568
+ visitForDisplayParts(node2.expression);
175569
+ parts.push({ text: "]" });
175570
+ break;
175450
175571
  default:
175451
175572
  Debug.failBadSyntaxKind(node2);
175452
175573
  }
@@ -178630,7 +178751,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symb
178630
178751
  }) || emptyArray;
178631
178752
  }
178632
178753
  }
178633
- if (tags.length === 0 && !hasMultipleSignatures) {
178754
+ if (tags.length === 0 && !hasMultipleSignatures && !isInJSDoc(location)) {
178634
178755
  tags = symbol.getContextualJsDocTags(enclosingDeclaration, typeChecker);
178635
178756
  }
178636
178757
  if (documentation.length === 0 && documentationFromAlias) {
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.9.0-dev.20250630",
5
+ "version": "5.9.0-dev.20250702",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -116,5 +116,5 @@
116
116
  "node": "20.1.0",
117
117
  "npm": "8.19.4"
118
118
  },
119
- "gitHead": "dfb74889780c1df7d0aeed1b32109142a6a2a09c"
119
+ "gitHead": "441655c270069e6c5cc6d989859afa232d5dafcb"
120
120
  }