typescript 5.8.0-dev.20241107 → 5.8.0-dev.20241109

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
@@ -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-dev.20241107`;
21
+ var version = `${versionMajorMinor}.0-dev.20241109`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
package/lib/typescript.js CHANGED
@@ -2278,7 +2278,7 @@ module.exports = __toCommonJS(typescript_exports);
2278
2278
 
2279
2279
  // src/compiler/corePublic.ts
2280
2280
  var versionMajorMinor = "5.8";
2281
- var version = `${versionMajorMinor}.0-dev.20241107`;
2281
+ var version = `${versionMajorMinor}.0-dev.20241109`;
2282
2282
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2283
2283
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2284
2284
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -159850,7 +159850,8 @@ var errorCodes28 = [
159850
159850
  Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,
159851
159851
  Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,
159852
159852
  Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
159853
- Diagnostics.Cannot_find_name_0.code
159853
+ Diagnostics.Cannot_find_name_0.code,
159854
+ Diagnostics.Type_0_does_not_satisfy_the_expected_type_1.code
159854
159855
  ];
159855
159856
  registerCodeFix({
159856
159857
  errorCodes: errorCodes28,
@@ -159887,9 +159888,9 @@ registerCodeFix({
159887
159888
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
159888
159889
  eachDiagnostic(context, errorCodes28, (diag2) => {
159889
159890
  const info = getInfo10(diag2.file, diag2.start, diag2.code, checker, context.program);
159890
- if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 /* ObjectLiteral */ ? info.identifier : info.token.text))) {
159891
- return;
159892
- }
159891
+ if (info === void 0) return;
159892
+ const nodeId = getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 /* ObjectLiteral */ ? info.identifier || getNodeId(info.token) : info.token.text);
159893
+ if (!addToSeen(seen, nodeId)) return;
159893
159894
  if (fixId56 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) {
159894
159895
  addFunctionDeclaration(changes, context, info);
159895
159896
  } else if (fixId56 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) {
@@ -159933,7 +159934,7 @@ registerCodeFix({
159933
159934
  }
159934
159935
  });
159935
159936
  function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
159936
- var _a, _b, _c;
159937
+ var _a, _b;
159937
159938
  const token = getTokenAtPosition(sourceFile, tokenPos);
159938
159939
  const parent2 = token.parent;
159939
159940
  if (errorCode === Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code) {
@@ -159955,23 +159956,25 @@ function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
159955
159956
  if (!length(properties)) return void 0;
159956
159957
  return { kind: 3 /* ObjectLiteral */, token: param.name, identifier: param.name.text, properties, parentDeclaration: parent2 };
159957
159958
  }
159958
- if (token.kind === 19 /* OpenBraceToken */ && isObjectLiteralExpression(parent2)) {
159959
- const targetType = (_a = checker.getContextualType(parent2) || checker.getTypeAtLocation(parent2)) == null ? void 0 : _a.getNonNullableType();
159960
- const properties = arrayFrom(checker.getUnmatchedProperties(
159961
- checker.getTypeAtLocation(parent2),
159962
- targetType,
159963
- /*requireOptionalProperties*/
159964
- false,
159965
- /*matchDiscriminantProperties*/
159966
- false
159967
- ));
159968
- if (!length(properties)) return void 0;
159969
- const identifier = "";
159970
- return { kind: 3 /* ObjectLiteral */, token: parent2, identifier, properties, parentDeclaration: parent2 };
159959
+ if (token.kind === 19 /* OpenBraceToken */ || isSatisfiesExpression(parent2) || isReturnStatement(parent2)) {
159960
+ const expression = (isSatisfiesExpression(parent2) || isReturnStatement(parent2)) && parent2.expression ? parent2.expression : parent2;
159961
+ if (isObjectLiteralExpression(expression)) {
159962
+ const targetType = isSatisfiesExpression(parent2) ? checker.getTypeFromTypeNode(parent2.type) : checker.getContextualType(expression) || checker.getTypeAtLocation(expression);
159963
+ const properties = arrayFrom(checker.getUnmatchedProperties(
159964
+ checker.getTypeAtLocation(parent2),
159965
+ targetType.getNonNullableType(),
159966
+ /*requireOptionalProperties*/
159967
+ false,
159968
+ /*matchDiscriminantProperties*/
159969
+ false
159970
+ ));
159971
+ if (!length(properties)) return void 0;
159972
+ return { kind: 3 /* ObjectLiteral */, token: parent2, identifier: void 0, properties, parentDeclaration: expression, indentation: isReturnStatement(expression.parent) || isYieldExpression(expression.parent) ? 0 : void 0 };
159973
+ }
159971
159974
  }
159972
159975
  if (!isMemberName(token)) return void 0;
159973
159976
  if (isIdentifier(token) && hasInitializer(parent2) && parent2.initializer && isObjectLiteralExpression(parent2.initializer)) {
159974
- const targetType = (_b = checker.getContextualType(token) || checker.getTypeAtLocation(token)) == null ? void 0 : _b.getNonNullableType();
159977
+ const targetType = (_a = checker.getContextualType(token) || checker.getTypeAtLocation(token)) == null ? void 0 : _a.getNonNullableType();
159975
159978
  const properties = arrayFrom(checker.getUnmatchedProperties(
159976
159979
  checker.getTypeAtLocation(parent2.initializer),
159977
159980
  targetType,
@@ -159990,7 +159993,7 @@ function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
159990
159993
  return { kind: 4 /* JsxAttributes */, token, attributes, parentDeclaration: token.parent };
159991
159994
  }
159992
159995
  if (isIdentifier(token)) {
159993
- const type = (_c = checker.getContextualType(token)) == null ? void 0 : _c.getNonNullableType();
159996
+ const type = (_b = checker.getContextualType(token)) == null ? void 0 : _b.getNonNullableType();
159994
159997
  if (type && getObjectFlags(type) & 16 /* Anonymous */) {
159995
159998
  const signature = firstOrUndefined(checker.getSignaturesOfType(type, 0 /* Call */));
159996
159999
  if (signature === void 0) return void 0;
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.8.0-dev.20241107",
5
+ "version": "5.8.0-dev.20241109",
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": "55f1248a2052eebdea6bc0e2eef754df89a44bf7"
119
+ "gitHead": "ef802b1e4ddaf8d6e61d6005614dd796520448f8"
120
120
  }