@typescript-deploys/pr-build 5.8.0-pr-60834-11 → 5.8.0-pr-60812-15

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.
Files changed (3) hide show
  1. package/lib/_tsc.js +117 -33
  2. package/lib/typescript.js +122 -39
  3. package/package.json +1 -1
package/lib/_tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.8";
21
- var version = `${versionMajorMinor}.0-insiders.20250104`;
21
+ var version = `${versionMajorMinor}.0-insiders.20250108`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -5501,10 +5501,97 @@ function resolvePath(path, ...paths) {
5501
5501
  function getNormalizedPathComponents(path, currentDirectory) {
5502
5502
  return reducePathComponents(getPathComponents(path, currentDirectory));
5503
5503
  }
5504
- function getNormalizedAbsolutePath(fileName, currentDirectory) {
5505
- return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
5504
+ function getNormalizedAbsolutePath(path, currentDirectory) {
5505
+ let rootLength = getRootLength(path);
5506
+ if (rootLength === 0 && currentDirectory) {
5507
+ path = combinePaths(currentDirectory, path);
5508
+ rootLength = getRootLength(path);
5509
+ }
5510
+ const simple = simpleNormalizePath(path);
5511
+ if (simple !== void 0) {
5512
+ return simple;
5513
+ }
5514
+ const root = path.substring(0, rootLength);
5515
+ const normalizedRoot = root && normalizeSlashes(root);
5516
+ let normalized = normalizedRoot === root ? void 0 : normalizedRoot;
5517
+ let index = rootLength;
5518
+ let segmentStart = index;
5519
+ let normalizedUpTo = index;
5520
+ let seenNonDotDotSegment = rootLength !== 0;
5521
+ while (index < path.length) {
5522
+ segmentStart = index;
5523
+ let ch = path.charCodeAt(index);
5524
+ while (isAnyDirectorySeparator(ch) && index + 1 < path.length) {
5525
+ index++;
5526
+ ch = path.charCodeAt(index);
5527
+ }
5528
+ if (index > segmentStart) {
5529
+ if (normalized === void 0) {
5530
+ normalized = path.substring(0, segmentStart - 1);
5531
+ }
5532
+ segmentStart = index;
5533
+ }
5534
+ const sepIndex = path.indexOf(directorySeparator, index + 1);
5535
+ const altSepIndex = path.indexOf(altDirectorySeparator, index + 1);
5536
+ let segmentEnd = sepIndex === -1 ? altSepIndex : altSepIndex === -1 ? sepIndex : Math.min(sepIndex, altSepIndex);
5537
+ if (segmentEnd === -1) {
5538
+ segmentEnd = path.length;
5539
+ }
5540
+ if (segmentEnd === altSepIndex && normalized === void 0) {
5541
+ normalized = path.substring(0, segmentStart);
5542
+ }
5543
+ const segmentLength = segmentEnd - segmentStart;
5544
+ if (segmentLength === 1 && path.charCodeAt(index) === 46 /* dot */) {
5545
+ if (normalized === void 0) {
5546
+ normalized = path.substring(0, normalizedUpTo);
5547
+ }
5548
+ } else if (segmentLength === 2 && path.charCodeAt(index) === 46 /* dot */ && path.charCodeAt(index + 1) === 46 /* dot */) {
5549
+ if (!seenNonDotDotSegment) {
5550
+ if (normalized !== void 0) {
5551
+ normalized += normalized.length === rootLength ? ".." : "/..";
5552
+ } else {
5553
+ normalizedUpTo = index + 2;
5554
+ }
5555
+ } else if (normalized === void 0) {
5556
+ if (normalizedUpTo - 2 >= 0) {
5557
+ normalized = path.substring(0, Math.max(rootLength, path.lastIndexOf(directorySeparator, normalizedUpTo - 2)));
5558
+ } else {
5559
+ normalized = path.substring(0, normalizedUpTo);
5560
+ }
5561
+ } else {
5562
+ const lastSlash = normalized.lastIndexOf(directorySeparator);
5563
+ if (lastSlash !== -1) {
5564
+ normalized = normalized.substring(0, Math.max(rootLength, lastSlash));
5565
+ } else {
5566
+ normalized = normalizedRoot;
5567
+ }
5568
+ if (normalized.length === rootLength) {
5569
+ seenNonDotDotSegment = rootLength !== 0;
5570
+ }
5571
+ }
5572
+ } else if (normalized !== void 0) {
5573
+ if (normalized.length !== rootLength) {
5574
+ normalized += directorySeparator;
5575
+ }
5576
+ seenNonDotDotSegment = true;
5577
+ normalized += path.substring(segmentStart, segmentEnd);
5578
+ } else {
5579
+ seenNonDotDotSegment = true;
5580
+ normalizedUpTo = segmentEnd;
5581
+ }
5582
+ index = segmentEnd + 1;
5583
+ }
5584
+ return normalized ?? (path.length > rootLength ? removeTrailingDirectorySeparator(path) : path);
5506
5585
  }
5507
5586
  function normalizePath(path) {
5587
+ let normalized = simpleNormalizePath(path);
5588
+ if (normalized !== void 0) {
5589
+ return normalized;
5590
+ }
5591
+ normalized = getNormalizedAbsolutePath(path, "");
5592
+ return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
5593
+ }
5594
+ function simpleNormalizePath(path) {
5508
5595
  path = normalizeSlashes(path);
5509
5596
  if (!relativePathSegmentRegExp.test(path)) {
5510
5597
  return path;
@@ -5516,8 +5603,7 @@ function normalizePath(path) {
5516
5603
  return path;
5517
5604
  }
5518
5605
  }
5519
- const normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path)));
5520
- return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
5606
+ return void 0;
5521
5607
  }
5522
5608
  function getPathWithoutRoot(pathComponents2) {
5523
5609
  if (pathComponents2.length === 0) return "";
@@ -42534,7 +42620,9 @@ function createBinder() {
42534
42620
  case 36 /* ExclamationEqualsToken */:
42535
42621
  case 37 /* EqualsEqualsEqualsToken */:
42536
42622
  case 38 /* ExclamationEqualsEqualsToken */:
42537
- return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right));
42623
+ const left = skipParentheses(expr.left);
42624
+ const right = skipParentheses(expr.right);
42625
+ return isNarrowableOperand(left) || isNarrowableOperand(right) || isNarrowingTypeofOperands(right, left) || isNarrowingTypeofOperands(left, right) || (isBooleanLiteral(right) && isNarrowingExpression(left) || isBooleanLiteral(left) && isNarrowingExpression(right));
42538
42626
  case 104 /* InstanceOfKeyword */:
42539
42627
  return isNarrowableOperand(expr.left);
42540
42628
  case 103 /* InKeyword */:
@@ -77870,7 +77958,7 @@ function createTypeChecker(host) {
77870
77958
  return false;
77871
77959
  }
77872
77960
  }
77873
- function getTypePredicateFromBody(func, contextualTypePredicate) {
77961
+ function getTypePredicateFromBody(func) {
77874
77962
  switch (func.kind) {
77875
77963
  case 176 /* Constructor */:
77876
77964
  case 177 /* GetAccessor */:
@@ -77889,29 +77977,28 @@ function createTypeChecker(host) {
77889
77977
  });
77890
77978
  if (bailedEarly || !singleReturn || functionHasImplicitReturn(func)) return void 0;
77891
77979
  }
77892
- const expr = skipParentheses(
77893
- singleReturn,
77980
+ return checkIfExpressionRefinesAnyParameter(func, singleReturn);
77981
+ }
77982
+ function checkIfExpressionRefinesAnyParameter(func, expr) {
77983
+ expr = skipParentheses(
77984
+ expr,
77894
77985
  /*excludeJSDocTypeAssertions*/
77895
77986
  true
77896
77987
  );
77897
77988
  const returnType = checkExpressionCached(expr);
77898
- if (contextualTypePredicate && returnType.flags & 512 /* BooleanLiteral */) {
77899
- const param = func.parameters[contextualTypePredicate.parameterIndex];
77900
- if (!isIdentifier(param.name)) {
77901
- return void 0;
77902
- }
77903
- const refinedType = returnType.intrinsicName === "true" ? getTypeOfSymbol(param.symbol) : neverType;
77904
- return createTypePredicate(1 /* Identifier */, unescapeLeadingUnderscores(param.name.escapedText), contextualTypePredicate.parameterIndex, refinedType);
77905
- }
77906
77989
  if (!(returnType.flags & 16 /* Boolean */)) return void 0;
77907
- return contextualTypePredicate ? getTypePredicateIfRefinesParameterAtIndex(func, expr, contextualTypePredicate, contextualTypePredicate.parameterIndex) : forEach(func.parameters, (_, i) => getTypePredicateIfRefinesParameterAtIndex(func, expr, contextualTypePredicate, i));
77990
+ return forEach(func.parameters, (param, i) => {
77991
+ const initType = getTypeOfSymbol(param.symbol);
77992
+ if (!initType || initType.flags & 16 /* Boolean */ || !isIdentifier(param.name) || isSymbolAssigned(param.symbol) || isRestParameter(param)) {
77993
+ return;
77994
+ }
77995
+ const trueType2 = checkIfExpressionRefinesParameter(func, expr, param, initType);
77996
+ if (trueType2) {
77997
+ return createTypePredicate(1 /* Identifier */, unescapeLeadingUnderscores(param.name.escapedText), i, trueType2);
77998
+ }
77999
+ });
77908
78000
  }
77909
- function getTypePredicateIfRefinesParameterAtIndex(func, expr, contextualTypePredicate, parameterIndex) {
77910
- const param = func.parameters[parameterIndex];
77911
- const initType = getTypeOfSymbol(param.symbol);
77912
- if (!initType || initType.flags & 16 /* Boolean */ || !isIdentifier(param.name) || isSymbolAssigned(param.symbol) || isRestParameter(param)) {
77913
- return;
77914
- }
78001
+ function checkIfExpressionRefinesParameter(func, expr, param, initType) {
77915
78002
  const antecedent = canHaveFlowNode(expr) && expr.flowNode || expr.parent.kind === 253 /* ReturnStatement */ && expr.parent.flowNode || createFlowNode(
77916
78003
  2 /* Start */,
77917
78004
  /*node*/
@@ -77921,12 +78008,10 @@ function createTypeChecker(host) {
77921
78008
  );
77922
78009
  const trueCondition = createFlowNode(32 /* TrueCondition */, expr, antecedent);
77923
78010
  const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition);
77924
- if (!contextualTypePredicate && trueType2 === initType) {
77925
- return void 0;
77926
- }
78011
+ if (trueType2 === initType) return void 0;
77927
78012
  const falseCondition = createFlowNode(64 /* FalseCondition */, expr, antecedent);
77928
78013
  const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition);
77929
- return falseSubtype.flags & 131072 /* Never */ ? createTypePredicate(1 /* Identifier */, unescapeLeadingUnderscores(param.name.escapedText), parameterIndex, trueType2) : void 0;
78014
+ return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0;
77930
78015
  }
77931
78016
  function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {
77932
78017
  addLazyDiagnostic(checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics);
@@ -78037,11 +78122,10 @@ function createTypeChecker(host) {
78037
78122
  inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
78038
78123
  }
78039
78124
  }
78040
- if (contextualSignature && !getReturnTypeFromAnnotation(node)) {
78041
- const returnType = signature.resolvedReturnType ?? getReturnTypeFromBody(node, checkMode);
78042
- signature.resolvedReturnType ?? (signature.resolvedReturnType = returnType);
78043
- if (signature.resolvedReturnType.flags && 16 /* Boolean */ && contextualSignature.resolvedTypePredicate && contextualSignature.resolvedTypePredicate !== noTypePredicate && contextualSignature.resolvedTypePredicate.kind === 1 /* Identifier */) {
78044
- signature.resolvedTypePredicate ?? (signature.resolvedTypePredicate = getTypePredicateFromBody(node, contextualSignature.resolvedTypePredicate) ?? noTypePredicate);
78125
+ if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
78126
+ const returnType = getReturnTypeFromBody(node, checkMode);
78127
+ if (!signature.resolvedReturnType) {
78128
+ signature.resolvedReturnType = returnType;
78045
78129
  }
78046
78130
  }
78047
78131
  checkSignatureDeclaration(node);
package/lib/typescript.js CHANGED
@@ -2279,7 +2279,7 @@ module.exports = __toCommonJS(typescript_exports);
2279
2279
 
2280
2280
  // src/compiler/corePublic.ts
2281
2281
  var versionMajorMinor = "5.8";
2282
- var version = `${versionMajorMinor}.0-insiders.20250104`;
2282
+ var version = `${versionMajorMinor}.0-insiders.20250108`;
2283
2283
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2284
2284
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2285
2285
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8875,10 +8875,97 @@ function resolvePath(path, ...paths) {
8875
8875
  function getNormalizedPathComponents(path, currentDirectory) {
8876
8876
  return reducePathComponents(getPathComponents(path, currentDirectory));
8877
8877
  }
8878
- function getNormalizedAbsolutePath(fileName, currentDirectory) {
8879
- return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
8878
+ function getNormalizedAbsolutePath(path, currentDirectory) {
8879
+ let rootLength = getRootLength(path);
8880
+ if (rootLength === 0 && currentDirectory) {
8881
+ path = combinePaths(currentDirectory, path);
8882
+ rootLength = getRootLength(path);
8883
+ }
8884
+ const simple = simpleNormalizePath(path);
8885
+ if (simple !== void 0) {
8886
+ return simple;
8887
+ }
8888
+ const root = path.substring(0, rootLength);
8889
+ const normalizedRoot = root && normalizeSlashes(root);
8890
+ let normalized = normalizedRoot === root ? void 0 : normalizedRoot;
8891
+ let index = rootLength;
8892
+ let segmentStart = index;
8893
+ let normalizedUpTo = index;
8894
+ let seenNonDotDotSegment = rootLength !== 0;
8895
+ while (index < path.length) {
8896
+ segmentStart = index;
8897
+ let ch = path.charCodeAt(index);
8898
+ while (isAnyDirectorySeparator(ch) && index + 1 < path.length) {
8899
+ index++;
8900
+ ch = path.charCodeAt(index);
8901
+ }
8902
+ if (index > segmentStart) {
8903
+ if (normalized === void 0) {
8904
+ normalized = path.substring(0, segmentStart - 1);
8905
+ }
8906
+ segmentStart = index;
8907
+ }
8908
+ const sepIndex = path.indexOf(directorySeparator, index + 1);
8909
+ const altSepIndex = path.indexOf(altDirectorySeparator, index + 1);
8910
+ let segmentEnd = sepIndex === -1 ? altSepIndex : altSepIndex === -1 ? sepIndex : Math.min(sepIndex, altSepIndex);
8911
+ if (segmentEnd === -1) {
8912
+ segmentEnd = path.length;
8913
+ }
8914
+ if (segmentEnd === altSepIndex && normalized === void 0) {
8915
+ normalized = path.substring(0, segmentStart);
8916
+ }
8917
+ const segmentLength = segmentEnd - segmentStart;
8918
+ if (segmentLength === 1 && path.charCodeAt(index) === 46 /* dot */) {
8919
+ if (normalized === void 0) {
8920
+ normalized = path.substring(0, normalizedUpTo);
8921
+ }
8922
+ } else if (segmentLength === 2 && path.charCodeAt(index) === 46 /* dot */ && path.charCodeAt(index + 1) === 46 /* dot */) {
8923
+ if (!seenNonDotDotSegment) {
8924
+ if (normalized !== void 0) {
8925
+ normalized += normalized.length === rootLength ? ".." : "/..";
8926
+ } else {
8927
+ normalizedUpTo = index + 2;
8928
+ }
8929
+ } else if (normalized === void 0) {
8930
+ if (normalizedUpTo - 2 >= 0) {
8931
+ normalized = path.substring(0, Math.max(rootLength, path.lastIndexOf(directorySeparator, normalizedUpTo - 2)));
8932
+ } else {
8933
+ normalized = path.substring(0, normalizedUpTo);
8934
+ }
8935
+ } else {
8936
+ const lastSlash = normalized.lastIndexOf(directorySeparator);
8937
+ if (lastSlash !== -1) {
8938
+ normalized = normalized.substring(0, Math.max(rootLength, lastSlash));
8939
+ } else {
8940
+ normalized = normalizedRoot;
8941
+ }
8942
+ if (normalized.length === rootLength) {
8943
+ seenNonDotDotSegment = rootLength !== 0;
8944
+ }
8945
+ }
8946
+ } else if (normalized !== void 0) {
8947
+ if (normalized.length !== rootLength) {
8948
+ normalized += directorySeparator;
8949
+ }
8950
+ seenNonDotDotSegment = true;
8951
+ normalized += path.substring(segmentStart, segmentEnd);
8952
+ } else {
8953
+ seenNonDotDotSegment = true;
8954
+ normalizedUpTo = segmentEnd;
8955
+ }
8956
+ index = segmentEnd + 1;
8957
+ }
8958
+ return normalized ?? (path.length > rootLength ? removeTrailingDirectorySeparator(path) : path);
8880
8959
  }
8881
8960
  function normalizePath(path) {
8961
+ let normalized = simpleNormalizePath(path);
8962
+ if (normalized !== void 0) {
8963
+ return normalized;
8964
+ }
8965
+ normalized = getNormalizedAbsolutePath(path, "");
8966
+ return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
8967
+ }
8968
+ function simpleNormalizePath(path) {
8882
8969
  path = normalizeSlashes(path);
8883
8970
  if (!relativePathSegmentRegExp.test(path)) {
8884
8971
  return path;
@@ -8890,8 +8977,7 @@ function normalizePath(path) {
8890
8977
  return path;
8891
8978
  }
8892
8979
  }
8893
- const normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path)));
8894
- return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
8980
+ return void 0;
8895
8981
  }
8896
8982
  function getPathWithoutRoot(pathComponents2) {
8897
8983
  if (pathComponents2.length === 0) return "";
@@ -47038,7 +47124,9 @@ function createBinder() {
47038
47124
  case 36 /* ExclamationEqualsToken */:
47039
47125
  case 37 /* EqualsEqualsEqualsToken */:
47040
47126
  case 38 /* ExclamationEqualsEqualsToken */:
47041
- return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right));
47127
+ const left = skipParentheses(expr.left);
47128
+ const right = skipParentheses(expr.right);
47129
+ return isNarrowableOperand(left) || isNarrowableOperand(right) || isNarrowingTypeofOperands(right, left) || isNarrowingTypeofOperands(left, right) || (isBooleanLiteral(right) && isNarrowingExpression(left) || isBooleanLiteral(left) && isNarrowingExpression(right));
47042
47130
  case 104 /* InstanceOfKeyword */:
47043
47131
  return isNarrowableOperand(expr.left);
47044
47132
  case 103 /* InKeyword */:
@@ -82474,7 +82562,7 @@ function createTypeChecker(host) {
82474
82562
  return false;
82475
82563
  }
82476
82564
  }
82477
- function getTypePredicateFromBody(func, contextualTypePredicate) {
82565
+ function getTypePredicateFromBody(func) {
82478
82566
  switch (func.kind) {
82479
82567
  case 176 /* Constructor */:
82480
82568
  case 177 /* GetAccessor */:
@@ -82493,29 +82581,28 @@ function createTypeChecker(host) {
82493
82581
  });
82494
82582
  if (bailedEarly || !singleReturn || functionHasImplicitReturn(func)) return void 0;
82495
82583
  }
82496
- const expr = skipParentheses(
82497
- singleReturn,
82584
+ return checkIfExpressionRefinesAnyParameter(func, singleReturn);
82585
+ }
82586
+ function checkIfExpressionRefinesAnyParameter(func, expr) {
82587
+ expr = skipParentheses(
82588
+ expr,
82498
82589
  /*excludeJSDocTypeAssertions*/
82499
82590
  true
82500
82591
  );
82501
82592
  const returnType = checkExpressionCached(expr);
82502
- if (contextualTypePredicate && returnType.flags & 512 /* BooleanLiteral */) {
82503
- const param = func.parameters[contextualTypePredicate.parameterIndex];
82504
- if (!isIdentifier(param.name)) {
82505
- return void 0;
82506
- }
82507
- const refinedType = returnType.intrinsicName === "true" ? getTypeOfSymbol(param.symbol) : neverType;
82508
- return createTypePredicate(1 /* Identifier */, unescapeLeadingUnderscores(param.name.escapedText), contextualTypePredicate.parameterIndex, refinedType);
82509
- }
82510
82593
  if (!(returnType.flags & 16 /* Boolean */)) return void 0;
82511
- return contextualTypePredicate ? getTypePredicateIfRefinesParameterAtIndex(func, expr, contextualTypePredicate, contextualTypePredicate.parameterIndex) : forEach(func.parameters, (_, i) => getTypePredicateIfRefinesParameterAtIndex(func, expr, contextualTypePredicate, i));
82594
+ return forEach(func.parameters, (param, i) => {
82595
+ const initType = getTypeOfSymbol(param.symbol);
82596
+ if (!initType || initType.flags & 16 /* Boolean */ || !isIdentifier(param.name) || isSymbolAssigned(param.symbol) || isRestParameter(param)) {
82597
+ return;
82598
+ }
82599
+ const trueType2 = checkIfExpressionRefinesParameter(func, expr, param, initType);
82600
+ if (trueType2) {
82601
+ return createTypePredicate(1 /* Identifier */, unescapeLeadingUnderscores(param.name.escapedText), i, trueType2);
82602
+ }
82603
+ });
82512
82604
  }
82513
- function getTypePredicateIfRefinesParameterAtIndex(func, expr, contextualTypePredicate, parameterIndex) {
82514
- const param = func.parameters[parameterIndex];
82515
- const initType = getTypeOfSymbol(param.symbol);
82516
- if (!initType || initType.flags & 16 /* Boolean */ || !isIdentifier(param.name) || isSymbolAssigned(param.symbol) || isRestParameter(param)) {
82517
- return;
82518
- }
82605
+ function checkIfExpressionRefinesParameter(func, expr, param, initType) {
82519
82606
  const antecedent = canHaveFlowNode(expr) && expr.flowNode || expr.parent.kind === 253 /* ReturnStatement */ && expr.parent.flowNode || createFlowNode(
82520
82607
  2 /* Start */,
82521
82608
  /*node*/
@@ -82525,12 +82612,10 @@ function createTypeChecker(host) {
82525
82612
  );
82526
82613
  const trueCondition = createFlowNode(32 /* TrueCondition */, expr, antecedent);
82527
82614
  const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition);
82528
- if (!contextualTypePredicate && trueType2 === initType) {
82529
- return void 0;
82530
- }
82615
+ if (trueType2 === initType) return void 0;
82531
82616
  const falseCondition = createFlowNode(64 /* FalseCondition */, expr, antecedent);
82532
82617
  const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition);
82533
- return falseSubtype.flags & 131072 /* Never */ ? createTypePredicate(1 /* Identifier */, unescapeLeadingUnderscores(param.name.escapedText), parameterIndex, trueType2) : void 0;
82618
+ return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0;
82534
82619
  }
82535
82620
  function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {
82536
82621
  addLazyDiagnostic(checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics);
@@ -82641,11 +82726,10 @@ function createTypeChecker(host) {
82641
82726
  inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
82642
82727
  }
82643
82728
  }
82644
- if (contextualSignature && !getReturnTypeFromAnnotation(node)) {
82645
- const returnType = signature.resolvedReturnType ?? getReturnTypeFromBody(node, checkMode);
82646
- signature.resolvedReturnType ?? (signature.resolvedReturnType = returnType);
82647
- if (signature.resolvedReturnType.flags && 16 /* Boolean */ && contextualSignature.resolvedTypePredicate && contextualSignature.resolvedTypePredicate !== noTypePredicate && contextualSignature.resolvedTypePredicate.kind === 1 /* Identifier */) {
82648
- signature.resolvedTypePredicate ?? (signature.resolvedTypePredicate = getTypePredicateFromBody(node, contextualSignature.resolvedTypePredicate) ?? noTypePredicate);
82729
+ if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
82730
+ const returnType = getReturnTypeFromBody(node, checkMode);
82731
+ if (!signature.resolvedReturnType) {
82732
+ signature.resolvedReturnType = returnType;
82649
82733
  }
82650
82734
  }
82651
82735
  checkSignatureDeclaration(node);
@@ -195455,20 +195539,19 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
195455
195539
  try {
195456
195540
  codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, this.getFormatOptions(file), this.getPreferences(file));
195457
195541
  } catch (e) {
195542
+ const error2 = e instanceof Error ? e : new Error(e);
195458
195543
  const ls = project.getLanguageService();
195459
195544
  const existingDiagCodes = [
195460
195545
  ...ls.getSyntacticDiagnostics(file),
195461
195546
  ...ls.getSemanticDiagnostics(file),
195462
195547
  ...ls.getSuggestionDiagnostics(file)
195463
- ].map(
195464
- (d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length) && d.code
195465
- );
195548
+ ].filter((d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length)).map((d) => d.code);
195466
195549
  const badCode = args.errorCodes.find((c) => !existingDiagCodes.includes(c));
195467
195550
  if (badCode !== void 0) {
195468
- e.message = `BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")}); could have caused this error:
195469
- ${e.message}`;
195551
+ error2.message += `
195552
+ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")})`;
195470
195553
  }
195471
- throw e;
195554
+ throw error2;
195472
195555
  }
195473
195556
  return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions;
195474
195557
  }
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.8.0-pr-60834-11",
5
+ "version": "5.8.0-pr-60812-15",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [