@typescript-deploys/pr-build 5.4.0-pr-56418-6 → 5.4.0-pr-55924-19

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.
@@ -43,7 +43,7 @@ interface SuppressedError extends Error {
43
43
  suppressed: any;
44
44
  }
45
45
 
46
- interface SuppressedErrorConstructor extends ErrorConstructor {
46
+ interface SuppressedErrorConstructor {
47
47
  new (error: any, suppressed: any, message?: string): SuppressedError;
48
48
  (error: any, suppressed: any, message?: string): SuppressedError;
49
49
  readonly prototype: SuppressedError;
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.4";
21
- var version = `${versionMajorMinor}.0-insiders.20231115`;
21
+ var version = `${versionMajorMinor}.0-insiders.20231116`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6791,6 +6791,8 @@ var Diagnostics = {
6791
6791
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
6792
6792
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
6793
6793
  Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
6794
+ Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
6795
+ Values_of_0_1_are_not_sufficiently_known: diag(4126, 1 /* Error */, "Values_of_0_1_are_not_sufficiently_known_4126", "Values of '{0}.{1}' are not sufficiently known."),
6794
6796
  The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
6795
6797
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
6796
6798
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -48268,6 +48270,8 @@ function createTypeChecker(host) {
48268
48270
  context.symbolDepth.set(id, depth + 1);
48269
48271
  }
48270
48272
  context.visitedTypes.add(typeId);
48273
+ const prevTrackedSymbols = context.trackedSymbols;
48274
+ context.trackedSymbols = void 0;
48271
48275
  const startLength = context.approximateLength;
48272
48276
  const result = transform(type2);
48273
48277
  const addedLength = context.approximateLength - startLength;
@@ -48283,6 +48287,7 @@ function createTypeChecker(host) {
48283
48287
  if (id) {
48284
48288
  context.symbolDepth.set(id, depth);
48285
48289
  }
48290
+ context.trackedSymbols = prevTrackedSymbols;
48286
48291
  return result;
48287
48292
  function deepCloneOrReuseNode(node) {
48288
48293
  if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
@@ -48585,7 +48590,7 @@ function createTypeChecker(host) {
48585
48590
  context.approximateLength += symbolName(propertySymbol).length + 1;
48586
48591
  if (propertySymbol.flags & 98304 /* Accessor */) {
48587
48592
  const writeType = getWriteTypeOfSymbol(propertySymbol);
48588
- if (propertyType !== writeType) {
48593
+ if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
48589
48594
  const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
48590
48595
  const getterSignature = getSignatureFromDeclaration(getterDeclaration);
48591
48596
  typeElements.push(
@@ -60152,12 +60157,12 @@ function createTypeChecker(host) {
60152
60157
  return !!(entry & 1 /* Succeeded */);
60153
60158
  }
60154
60159
  const targetEnumType = getTypeOfSymbol(targetSymbol);
60155
- for (const property of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
60156
- if (property.flags & 8 /* EnumMember */) {
60157
- const targetProperty = getPropertyOfType(targetEnumType, property.escapedName);
60160
+ for (const sourceProperty of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
60161
+ if (sourceProperty.flags & 8 /* EnumMember */) {
60162
+ const targetProperty = getPropertyOfType(targetEnumType, sourceProperty.escapedName);
60158
60163
  if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) {
60159
60164
  if (errorReporter) {
60160
- errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property), typeToString(
60165
+ errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(sourceProperty), typeToString(
60161
60166
  getDeclaredTypeOfSymbol(targetSymbol),
60162
60167
  /*enclosingDeclaration*/
60163
60168
  void 0,
@@ -60169,6 +60174,22 @@ function createTypeChecker(host) {
60169
60174
  }
60170
60175
  return false;
60171
60176
  }
60177
+ const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 306 /* EnumMember */));
60178
+ const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 306 /* EnumMember */));
60179
+ if (sourceValue !== targetValue || sourceValue === void 0 || targetValue === void 0) {
60180
+ if (!errorReporter) {
60181
+ enumRelation.set(id, 2 /* Failed */);
60182
+ } else if (sourceValue !== targetValue && sourceValue !== void 0 && targetValue !== void 0) {
60183
+ const escapedSource = typeof sourceValue === "string" ? `"${escapeString(sourceValue)}"` : sourceValue;
60184
+ const escapedTarget = typeof targetValue === "string" ? `"${escapeString(targetValue)}"` : targetValue;
60185
+ errorReporter(Diagnostics.Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given, symbolName(targetSymbol), symbolName(targetProperty), escapedTarget, escapedSource);
60186
+ enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
60187
+ } else {
60188
+ errorReporter(Diagnostics.Values_of_0_1_are_not_sufficiently_known, symbolName(targetSymbol), symbolName(targetProperty));
60189
+ enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
60190
+ }
60191
+ return false;
60192
+ }
60172
60193
  }
60173
60194
  }
60174
60195
  enumRelation.set(id, 1 /* Succeeded */);
@@ -75536,7 +75557,7 @@ function createTypeChecker(host) {
75536
75557
  const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
75537
75558
  if (modifiers) {
75538
75559
  const symbol = getSymbolOfDeclaration(node.parent);
75539
- if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
75560
+ if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
75540
75561
  error(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
75541
75562
  } else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
75542
75563
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
package/lib/tsserver.js CHANGED
@@ -2330,7 +2330,7 @@ module.exports = __toCommonJS(server_exports);
2330
2330
 
2331
2331
  // src/compiler/corePublic.ts
2332
2332
  var versionMajorMinor = "5.4";
2333
- var version = `${versionMajorMinor}.0-insiders.20231115`;
2333
+ var version = `${versionMajorMinor}.0-insiders.20231116`;
2334
2334
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2335
2335
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2336
2336
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10323,6 +10323,8 @@ var Diagnostics = {
10323
10323
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
10324
10324
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
10325
10325
  Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
10326
+ Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
10327
+ Values_of_0_1_are_not_sufficiently_known: diag(4126, 1 /* Error */, "Values_of_0_1_are_not_sufficiently_known_4126", "Values of '{0}.{1}' are not sufficiently known."),
10326
10328
  The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
10327
10329
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
10328
10330
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -52976,6 +52978,8 @@ function createTypeChecker(host) {
52976
52978
  context.symbolDepth.set(id, depth + 1);
52977
52979
  }
52978
52980
  context.visitedTypes.add(typeId);
52981
+ const prevTrackedSymbols = context.trackedSymbols;
52982
+ context.trackedSymbols = void 0;
52979
52983
  const startLength = context.approximateLength;
52980
52984
  const result = transform2(type2);
52981
52985
  const addedLength = context.approximateLength - startLength;
@@ -52991,6 +52995,7 @@ function createTypeChecker(host) {
52991
52995
  if (id) {
52992
52996
  context.symbolDepth.set(id, depth);
52993
52997
  }
52998
+ context.trackedSymbols = prevTrackedSymbols;
52994
52999
  return result;
52995
53000
  function deepCloneOrReuseNode(node) {
52996
53001
  if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
@@ -53293,7 +53298,7 @@ function createTypeChecker(host) {
53293
53298
  context.approximateLength += symbolName(propertySymbol).length + 1;
53294
53299
  if (propertySymbol.flags & 98304 /* Accessor */) {
53295
53300
  const writeType = getWriteTypeOfSymbol(propertySymbol);
53296
- if (propertyType !== writeType) {
53301
+ if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
53297
53302
  const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
53298
53303
  const getterSignature = getSignatureFromDeclaration(getterDeclaration);
53299
53304
  typeElements.push(
@@ -64860,12 +64865,12 @@ function createTypeChecker(host) {
64860
64865
  return !!(entry & 1 /* Succeeded */);
64861
64866
  }
64862
64867
  const targetEnumType = getTypeOfSymbol(targetSymbol);
64863
- for (const property of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
64864
- if (property.flags & 8 /* EnumMember */) {
64865
- const targetProperty = getPropertyOfType(targetEnumType, property.escapedName);
64868
+ for (const sourceProperty of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
64869
+ if (sourceProperty.flags & 8 /* EnumMember */) {
64870
+ const targetProperty = getPropertyOfType(targetEnumType, sourceProperty.escapedName);
64866
64871
  if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) {
64867
64872
  if (errorReporter) {
64868
- errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property), typeToString(
64873
+ errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(sourceProperty), typeToString(
64869
64874
  getDeclaredTypeOfSymbol(targetSymbol),
64870
64875
  /*enclosingDeclaration*/
64871
64876
  void 0,
@@ -64877,6 +64882,22 @@ function createTypeChecker(host) {
64877
64882
  }
64878
64883
  return false;
64879
64884
  }
64885
+ const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 306 /* EnumMember */));
64886
+ const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 306 /* EnumMember */));
64887
+ if (sourceValue !== targetValue || sourceValue === void 0 || targetValue === void 0) {
64888
+ if (!errorReporter) {
64889
+ enumRelation.set(id, 2 /* Failed */);
64890
+ } else if (sourceValue !== targetValue && sourceValue !== void 0 && targetValue !== void 0) {
64891
+ const escapedSource = typeof sourceValue === "string" ? `"${escapeString(sourceValue)}"` : sourceValue;
64892
+ const escapedTarget = typeof targetValue === "string" ? `"${escapeString(targetValue)}"` : targetValue;
64893
+ errorReporter(Diagnostics.Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given, symbolName(targetSymbol), symbolName(targetProperty), escapedTarget, escapedSource);
64894
+ enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
64895
+ } else {
64896
+ errorReporter(Diagnostics.Values_of_0_1_are_not_sufficiently_known, symbolName(targetSymbol), symbolName(targetProperty));
64897
+ enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
64898
+ }
64899
+ return false;
64900
+ }
64880
64901
  }
64881
64902
  }
64882
64903
  enumRelation.set(id, 1 /* Succeeded */);
@@ -80244,7 +80265,7 @@ function createTypeChecker(host) {
80244
80265
  const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
80245
80266
  if (modifiers) {
80246
80267
  const symbol = getSymbolOfDeclaration(node.parent);
80247
- if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
80268
+ if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
80248
80269
  error2(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
80249
80270
  } else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
80250
80271
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
@@ -158921,6 +158942,9 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con
158921
158942
  if (!info || uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === 1 /* Global */ && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) {
158922
158943
  continue;
158923
158944
  }
158945
+ if (!isTypeOnlyLocation && isInJSFile(sourceFile) && symbolAppearsToBeTypeOnly(symbol)) {
158946
+ continue;
158947
+ }
158924
158948
  const { name, needsConvertPropertyAccess } = info;
158925
158949
  const originalSortText = (symbolToSortTextMap == null ? void 0 : symbolToSortTextMap[getSymbolId(symbol)]) ?? SortText.LocationPriority;
158926
158950
  const sortText = isDeprecated(symbol, typeChecker) ? SortText.Deprecated(originalSortText) : originalSortText;
@@ -159000,6 +159024,10 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con
159000
159024
  }
159001
159025
  return !!(allFlags & 111551 /* Value */);
159002
159026
  }
159027
+ function symbolAppearsToBeTypeOnly(symbol) {
159028
+ var _a;
159029
+ return !(symbol.flags & 111551 /* Value */) && (!isInJSFile((_a = symbol.declarations) == null ? void 0 : _a[0]) || !!(symbol.flags & 788968 /* Type */));
159030
+ }
159003
159031
  }
159004
159032
  function getLabelCompletionAtPosition(node) {
159005
159033
  const entries = getLabelStatementCompletions(node);
@@ -175479,7 +175507,7 @@ var TypingsInstaller = class {
175479
175507
  }
175480
175508
  /** @internal */
175481
175509
  installPackage(req) {
175482
- const { fileName, packageName, projectName, projectRootPath } = req;
175510
+ const { fileName, packageName, projectName, projectRootPath, id } = req;
175483
175511
  const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
175484
175512
  if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) {
175485
175513
  return directory;
@@ -175491,6 +175519,7 @@ var TypingsInstaller = class {
175491
175519
  const response = {
175492
175520
  kind: ActionPackageInstalled,
175493
175521
  projectName,
175522
+ id,
175494
175523
  success,
175495
175524
  message
175496
175525
  };
@@ -175500,6 +175529,7 @@ var TypingsInstaller = class {
175500
175529
  const response = {
175501
175530
  kind: ActionPackageInstalled,
175502
175531
  projectName,
175532
+ id,
175503
175533
  success: false,
175504
175534
  message: "Could not determine a project root path."
175505
175535
  };
@@ -186695,6 +186725,7 @@ var _TypingsInstallerAdapter = class _TypingsInstallerAdapter {
186695
186725
  // Maps project name to newest requestQueue entry for that project
186696
186726
  /** We will lazily request the types registry on the first call to `isKnownTypesPackageName` and store it in `typesRegistryCache`. */
186697
186727
  this.requestedRegistry = false;
186728
+ this.packageInstallId = 0;
186698
186729
  }
186699
186730
  isKnownTypesPackageName(name) {
186700
186731
  var _a;
@@ -186709,11 +186740,13 @@ var _TypingsInstallerAdapter = class _TypingsInstallerAdapter {
186709
186740
  return !!((_a = this.typesRegistryCache) == null ? void 0 : _a.has(name));
186710
186741
  }
186711
186742
  installPackage(options) {
186712
- this.installer.send({ kind: "installPackage", ...options });
186713
- Debug.assert(this.packageInstalledPromise === void 0);
186714
- return new Promise((resolve, reject) => {
186715
- this.packageInstalledPromise = { resolve, reject };
186743
+ this.packageInstallId++;
186744
+ const request = { kind: "installPackage", ...options, id: this.packageInstallId };
186745
+ const promise = new Promise((resolve, reject) => {
186746
+ (this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve, reject });
186716
186747
  });
186748
+ this.installer.send(request);
186749
+ return promise;
186717
186750
  }
186718
186751
  attach(projectService) {
186719
186752
  this.projectService = projectService;
@@ -186738,6 +186771,7 @@ var _TypingsInstallerAdapter = class _TypingsInstallerAdapter {
186738
186771
  }
186739
186772
  }
186740
186773
  handleMessage(response) {
186774
+ var _a, _b;
186741
186775
  if (this.logger.hasLevel(3 /* verbose */)) {
186742
186776
  this.logger.info(`TIAdapter:: Received response:${stringifyIndented(response)}`);
186743
186777
  }
@@ -186746,13 +186780,14 @@ var _TypingsInstallerAdapter = class _TypingsInstallerAdapter {
186746
186780
  this.typesRegistryCache = new Map(Object.entries(response.typesRegistry));
186747
186781
  break;
186748
186782
  case ActionPackageInstalled: {
186749
- const { success, message } = response;
186750
- if (success) {
186751
- this.packageInstalledPromise.resolve({ successMessage: message });
186783
+ const promise = (_a = this.packageInstalledPromise) == null ? void 0 : _a.get(response.id);
186784
+ Debug.assertIsDefined(promise, "Should find the promise for package install");
186785
+ (_b = this.packageInstalledPromise) == null ? void 0 : _b.delete(response.id);
186786
+ if (response.success) {
186787
+ promise.resolve({ successMessage: response.message });
186752
186788
  } else {
186753
- this.packageInstalledPromise.reject(message);
186789
+ promise.reject(response.message);
186754
186790
  }
186755
- this.packageInstalledPromise = void 0;
186756
186791
  this.projectService.updateTypingsForProject(response);
186757
186792
  this.event(response, "setTypings");
186758
186793
  break;
@@ -49,9 +49,11 @@ declare namespace ts {
49
49
  readonly fileName: Path;
50
50
  readonly packageName: string;
51
51
  readonly projectRootPath: Path;
52
+ readonly id: number;
52
53
  }
53
54
  interface PackageInstalledResponse extends ProjectResponse {
54
55
  readonly kind: ActionPackageInstalled;
56
+ readonly id: number;
55
57
  readonly success: boolean;
56
58
  readonly message: string;
57
59
  }
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.4";
38
- version = `${versionMajorMinor}.0-insiders.20231115`;
38
+ version = `${versionMajorMinor}.0-insiders.20231116`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8103,6 +8103,8 @@ ${lanes.join("\n")}
8103
8103
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
8104
8104
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
8105
8105
  Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
8106
+ Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
8107
+ Values_of_0_1_are_not_sufficiently_known: diag(4126, 1 /* Error */, "Values_of_0_1_are_not_sufficiently_known_4126", "Values of '{0}.{1}' are not sufficiently known."),
8106
8108
  The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
8107
8109
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
8108
8110
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -50741,6 +50743,8 @@ ${lanes.join("\n")}
50741
50743
  context.symbolDepth.set(id, depth + 1);
50742
50744
  }
50743
50745
  context.visitedTypes.add(typeId);
50746
+ const prevTrackedSymbols = context.trackedSymbols;
50747
+ context.trackedSymbols = void 0;
50744
50748
  const startLength = context.approximateLength;
50745
50749
  const result = transform2(type2);
50746
50750
  const addedLength = context.approximateLength - startLength;
@@ -50756,6 +50760,7 @@ ${lanes.join("\n")}
50756
50760
  if (id) {
50757
50761
  context.symbolDepth.set(id, depth);
50758
50762
  }
50763
+ context.trackedSymbols = prevTrackedSymbols;
50759
50764
  return result;
50760
50765
  function deepCloneOrReuseNode(node) {
50761
50766
  if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
@@ -51058,7 +51063,7 @@ ${lanes.join("\n")}
51058
51063
  context.approximateLength += symbolName(propertySymbol).length + 1;
51059
51064
  if (propertySymbol.flags & 98304 /* Accessor */) {
51060
51065
  const writeType = getWriteTypeOfSymbol(propertySymbol);
51061
- if (propertyType !== writeType) {
51066
+ if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
51062
51067
  const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
51063
51068
  const getterSignature = getSignatureFromDeclaration(getterDeclaration);
51064
51069
  typeElements.push(
@@ -62625,12 +62630,12 @@ ${lanes.join("\n")}
62625
62630
  return !!(entry & 1 /* Succeeded */);
62626
62631
  }
62627
62632
  const targetEnumType = getTypeOfSymbol(targetSymbol);
62628
- for (const property of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
62629
- if (property.flags & 8 /* EnumMember */) {
62630
- const targetProperty = getPropertyOfType(targetEnumType, property.escapedName);
62633
+ for (const sourceProperty of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
62634
+ if (sourceProperty.flags & 8 /* EnumMember */) {
62635
+ const targetProperty = getPropertyOfType(targetEnumType, sourceProperty.escapedName);
62631
62636
  if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) {
62632
62637
  if (errorReporter) {
62633
- errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property), typeToString(
62638
+ errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(sourceProperty), typeToString(
62634
62639
  getDeclaredTypeOfSymbol(targetSymbol),
62635
62640
  /*enclosingDeclaration*/
62636
62641
  void 0,
@@ -62642,6 +62647,22 @@ ${lanes.join("\n")}
62642
62647
  }
62643
62648
  return false;
62644
62649
  }
62650
+ const sourceValue = getEnumMemberValue(getDeclarationOfKind(sourceProperty, 306 /* EnumMember */));
62651
+ const targetValue = getEnumMemberValue(getDeclarationOfKind(targetProperty, 306 /* EnumMember */));
62652
+ if (sourceValue !== targetValue || sourceValue === void 0 || targetValue === void 0) {
62653
+ if (!errorReporter) {
62654
+ enumRelation.set(id, 2 /* Failed */);
62655
+ } else if (sourceValue !== targetValue && sourceValue !== void 0 && targetValue !== void 0) {
62656
+ const escapedSource = typeof sourceValue === "string" ? `"${escapeString(sourceValue)}"` : sourceValue;
62657
+ const escapedTarget = typeof targetValue === "string" ? `"${escapeString(targetValue)}"` : targetValue;
62658
+ errorReporter(Diagnostics.Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given, symbolName(targetSymbol), symbolName(targetProperty), escapedTarget, escapedSource);
62659
+ enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
62660
+ } else {
62661
+ errorReporter(Diagnostics.Values_of_0_1_are_not_sufficiently_known, symbolName(targetSymbol), symbolName(targetProperty));
62662
+ enumRelation.set(id, 2 /* Failed */ | 4 /* Reported */);
62663
+ }
62664
+ return false;
62665
+ }
62645
62666
  }
62646
62667
  }
62647
62668
  enumRelation.set(id, 1 /* Succeeded */);
@@ -78009,7 +78030,7 @@ ${lanes.join("\n")}
78009
78030
  const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
78010
78031
  if (modifiers) {
78011
78032
  const symbol = getSymbolOfDeclaration(node.parent);
78012
- if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
78033
+ if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
78013
78034
  error2(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
78014
78035
  } else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
78015
78036
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
@@ -158144,6 +158165,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
158144
158165
  if (!info || uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === 1 /* Global */ && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) {
158145
158166
  continue;
158146
158167
  }
158168
+ if (!isTypeOnlyLocation && isInJSFile(sourceFile) && symbolAppearsToBeTypeOnly(symbol)) {
158169
+ continue;
158170
+ }
158147
158171
  const { name, needsConvertPropertyAccess } = info;
158148
158172
  const originalSortText = (symbolToSortTextMap == null ? void 0 : symbolToSortTextMap[getSymbolId(symbol)]) ?? SortText.LocationPriority;
158149
158173
  const sortText = isDeprecated(symbol, typeChecker) ? SortText.Deprecated(originalSortText) : originalSortText;
@@ -158223,6 +158247,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
158223
158247
  }
158224
158248
  return !!(allFlags & 111551 /* Value */);
158225
158249
  }
158250
+ function symbolAppearsToBeTypeOnly(symbol) {
158251
+ var _a;
158252
+ return !(symbol.flags & 111551 /* Value */) && (!isInJSFile((_a = symbol.declarations) == null ? void 0 : _a[0]) || !!(symbol.flags & 788968 /* Type */));
158253
+ }
158226
158254
  }
158227
158255
  function getLabelCompletionAtPosition(node) {
158228
158256
  const entries = getLabelStatementCompletions(node);
@@ -172693,7 +172721,7 @@ ${options.prefix}` : "\n" : options.prefix
172693
172721
  }
172694
172722
  /** @internal */
172695
172723
  installPackage(req) {
172696
- const { fileName, packageName, projectName, projectRootPath } = req;
172724
+ const { fileName, packageName, projectName, projectRootPath, id } = req;
172697
172725
  const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
172698
172726
  if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) {
172699
172727
  return directory;
@@ -172705,6 +172733,7 @@ ${options.prefix}` : "\n" : options.prefix
172705
172733
  const response = {
172706
172734
  kind: ActionPackageInstalled,
172707
172735
  projectName,
172736
+ id,
172708
172737
  success,
172709
172738
  message
172710
172739
  };
@@ -172714,6 +172743,7 @@ ${options.prefix}` : "\n" : options.prefix
172714
172743
  const response = {
172715
172744
  kind: ActionPackageInstalled,
172716
172745
  projectName,
172746
+ id,
172717
172747
  success: false,
172718
172748
  message: "Could not determine a project root path."
172719
172749
  };
@@ -184034,6 +184064,7 @@ ${e.message}`;
184034
184064
  // Maps project name to newest requestQueue entry for that project
184035
184065
  /** We will lazily request the types registry on the first call to `isKnownTypesPackageName` and store it in `typesRegistryCache`. */
184036
184066
  this.requestedRegistry = false;
184067
+ this.packageInstallId = 0;
184037
184068
  }
184038
184069
  isKnownTypesPackageName(name) {
184039
184070
  var _a;
@@ -184048,11 +184079,13 @@ ${e.message}`;
184048
184079
  return !!((_a = this.typesRegistryCache) == null ? void 0 : _a.has(name));
184049
184080
  }
184050
184081
  installPackage(options) {
184051
- this.installer.send({ kind: "installPackage", ...options });
184052
- Debug.assert(this.packageInstalledPromise === void 0);
184053
- return new Promise((resolve, reject) => {
184054
- this.packageInstalledPromise = { resolve, reject };
184082
+ this.packageInstallId++;
184083
+ const request = { kind: "installPackage", ...options, id: this.packageInstallId };
184084
+ const promise = new Promise((resolve, reject) => {
184085
+ (this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve, reject });
184055
184086
  });
184087
+ this.installer.send(request);
184088
+ return promise;
184056
184089
  }
184057
184090
  attach(projectService) {
184058
184091
  this.projectService = projectService;
@@ -184077,6 +184110,7 @@ ${e.message}`;
184077
184110
  }
184078
184111
  }
184079
184112
  handleMessage(response) {
184113
+ var _a, _b;
184080
184114
  if (this.logger.hasLevel(3 /* verbose */)) {
184081
184115
  this.logger.info(`TIAdapter:: Received response:${stringifyIndented(response)}`);
184082
184116
  }
@@ -184085,13 +184119,14 @@ ${e.message}`;
184085
184119
  this.typesRegistryCache = new Map(Object.entries(response.typesRegistry));
184086
184120
  break;
184087
184121
  case ActionPackageInstalled: {
184088
- const { success, message } = response;
184089
- if (success) {
184090
- this.packageInstalledPromise.resolve({ successMessage: message });
184122
+ const promise = (_a = this.packageInstalledPromise) == null ? void 0 : _a.get(response.id);
184123
+ Debug.assertIsDefined(promise, "Should find the promise for package install");
184124
+ (_b = this.packageInstalledPromise) == null ? void 0 : _b.delete(response.id);
184125
+ if (response.success) {
184126
+ promise.resolve({ successMessage: response.message });
184091
184127
  } else {
184092
- this.packageInstalledPromise.reject(message);
184128
+ promise.reject(response.message);
184093
184129
  }
184094
- this.packageInstalledPromise = void 0;
184095
184130
  this.projectService.updateTypingsForProject(response);
184096
184131
  this.event(response, "setTypings");
184097
184132
  break;
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.4";
57
- var version = `${versionMajorMinor}.0-insiders.20231115`;
57
+ var version = `${versionMajorMinor}.0-insiders.20231116`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -6168,6 +6168,8 @@ var Diagnostics = {
6168
6168
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
6169
6169
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
6170
6170
  Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
6171
+ Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
6172
+ Values_of_0_1_are_not_sufficiently_known: diag(4126, 1 /* Error */, "Values_of_0_1_are_not_sufficiently_known_4126", "Values of '{0}.{1}' are not sufficiently known."),
6171
6173
  The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
6172
6174
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
6173
6175
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -31947,7 +31949,7 @@ var TypingsInstaller = class {
31947
31949
  }
31948
31950
  /** @internal */
31949
31951
  installPackage(req) {
31950
- const { fileName, packageName, projectName, projectRootPath } = req;
31952
+ const { fileName, packageName, projectName, projectRootPath, id } = req;
31951
31953
  const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
31952
31954
  if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) {
31953
31955
  return directory;
@@ -31959,6 +31961,7 @@ var TypingsInstaller = class {
31959
31961
  const response = {
31960
31962
  kind: ActionPackageInstalled,
31961
31963
  projectName,
31964
+ id,
31962
31965
  success,
31963
31966
  message
31964
31967
  };
@@ -31968,6 +31971,7 @@ var TypingsInstaller = class {
31968
31971
  const response = {
31969
31972
  kind: ActionPackageInstalled,
31970
31973
  projectName,
31974
+ id,
31971
31975
  success: false,
31972
31976
  message: "Could not determine a project root path."
31973
31977
  };
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.4.0-pr-56418-6",
5
+ "version": "5.4.0-pr-55924-19",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "66b933eedd4e6149c1a51829ee6d2047ff00c8d2"
118
+ "gitHead": "36d8abbd73baf59639b0f1ee32c9295260063495"
119
119
  }