@typescript-deploys/pr-build 5.3.0-pr-55567-5 → 5.3.0-pr-55860-30

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.3";
21
- var version = `${versionMajorMinor}.0-insiders.20230927`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230928`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -4839,11 +4839,12 @@ var sys = (() => {
4839
4839
  let activeSession;
4840
4840
  let profilePath = "./profile.cpuprofile";
4841
4841
  const Buffer = require("buffer").Buffer;
4842
- const isWindows = process.platform === "win32";
4842
+ const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
4843
+ const platform = _os.platform();
4843
4844
  const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
4844
- const fsRealpath = !!_fs.realpathSync.native ? isWindows ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
4845
+ const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
4845
4846
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
4846
- const fsSupportsRecursiveFsWatch = isWindows || process.platform === "darwin";
4847
+ const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
4847
4848
  const getCurrentDirectory = memoize(() => process.cwd());
4848
4849
  const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
4849
4850
  pollingWatchFileWorker: fsWatchFileWorker,
@@ -4862,7 +4863,7 @@ var sys = (() => {
4862
4863
  tscWatchFile: process.env.TSC_WATCHFILE,
4863
4864
  useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
4864
4865
  tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
4865
- inodeWatching: !isWindows,
4866
+ inodeWatching: isLinuxOrMacOs,
4866
4867
  sysLog
4867
4868
  });
4868
4869
  const nodeSystem = {
@@ -5047,7 +5048,7 @@ var sys = (() => {
5047
5048
  return Buffer.from && Buffer.from !== Int8Array.from ? Buffer.from(input, encoding) : new Buffer(input, encoding);
5048
5049
  }
5049
5050
  function isFileSystemCaseSensitive() {
5050
- if (isWindows) {
5051
+ if (platform === "win32" || platform === "win64") {
5051
5052
  return false;
5052
5053
  }
5053
5054
  return !fileExists(swapCase(__filename));
@@ -6650,6 +6651,7 @@ var Diagnostics = {
6650
6651
  Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
6651
6652
  Import_attribute_values_must_be_string_literal_expressions: diag(2858, 1 /* Error */, "Import_attribute_values_must_be_string_literal_expressions_2858", "Import attribute values must be string literal expressions."),
6652
6653
  Excessive_complexity_comparing_types_0_and_1: diag(2859, 1 /* Error */, "Excessive_complexity_comparing_types_0_and_1_2859", "Excessive complexity comparing types '{0}' and '{1}'."),
6654
+ The_type_of_this_declaration_is_ambiguous_and_may_be_observed_as_either_0_or_1: diag(2860, 1 /* Error */, "The_type_of_this_declaration_is_ambiguous_and_may_be_observed_as_either_0_or_1_2860", "The type of this declaration is ambiguous and may be observed as either '{0}' or '{1}'."),
6653
6655
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
6654
6656
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
6655
6657
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -44067,6 +44069,7 @@ function createTypeChecker(host) {
44067
44069
  var potentialReflectCollisions = [];
44068
44070
  var potentialUnusedRenamedBindingElementsInTypes = [];
44069
44071
  var awaitedTypeStack = [];
44072
+ var ambiguousVariableDeclarationsWhenWidened = [];
44070
44073
  var diagnostics = createDiagnosticCollection();
44071
44074
  var suggestionDiagnostics = createDiagnosticCollection();
44072
44075
  var typeofType = createTypeofType();
@@ -77526,6 +77529,29 @@ function createTypeChecker(host) {
77526
77529
  }
77527
77530
  checkCollisionsForDeclarationName(node, node.name);
77528
77531
  }
77532
+ function canHaveLiteralInitializer2(node2) {
77533
+ switch (node2.kind) {
77534
+ case 172 /* PropertyDeclaration */:
77535
+ case 171 /* PropertySignature */:
77536
+ return !hasEffectiveModifier(node2, 8 /* Private */);
77537
+ case 169 /* Parameter */:
77538
+ case 260 /* VariableDeclaration */:
77539
+ return true;
77540
+ }
77541
+ return false;
77542
+ }
77543
+ function shouldPrintWithInitializer(node2) {
77544
+ return canHaveLiteralInitializer2(node2) && isLiteralConstDeclaration(node2);
77545
+ }
77546
+ function isPrivateDeclaration(node2) {
77547
+ return hasEffectiveModifier(node2, 8 /* Private */) || isPrivateIdentifierClassElementDeclaration(node2);
77548
+ }
77549
+ if (getEmitDeclarations(compilerOptions) && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) && !shouldPrintWithInitializer(node) && !isPrivateDeclaration(node)) {
77550
+ const widenedLiteralType = getWidenedLiteralType(type);
77551
+ if (!isTypeIdenticalTo(type, widenedLiteralType)) {
77552
+ ambiguousVariableDeclarationsWhenWidened.push([node, type, widenedLiteralType]);
77553
+ }
77554
+ }
77529
77555
  }
77530
77556
  function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) {
77531
77557
  const nextDeclarationName = getNameOfDeclaration(nextDeclaration);
@@ -80741,6 +80767,7 @@ function createTypeChecker(host) {
80741
80767
  clear(potentialWeakMapSetCollisions);
80742
80768
  clear(potentialReflectCollisions);
80743
80769
  clear(potentialUnusedRenamedBindingElementsInTypes);
80770
+ clear(ambiguousVariableDeclarationsWhenWidened);
80744
80771
  forEach(node.statements, checkSourceElement);
80745
80772
  checkSourceElement(node.endOfFileToken);
80746
80773
  checkDeferredNodes(node);
@@ -80759,6 +80786,23 @@ function createTypeChecker(host) {
80759
80786
  checkPotentialUncheckedRenamedBindingElementsInTypes();
80760
80787
  }
80761
80788
  });
80789
+ addLazyDiagnostic(() => {
80790
+ function isVisibleExternally(elem) {
80791
+ if (isOmittedExpression(elem)) {
80792
+ return false;
80793
+ }
80794
+ if (isBindingPattern(elem.name)) {
80795
+ return some(elem.name.elements, isVisibleExternally);
80796
+ } else {
80797
+ return isDeclarationVisible(elem);
80798
+ }
80799
+ }
80800
+ for (const [node2, type, widenedLiteralType] of ambiguousVariableDeclarationsWhenWidened) {
80801
+ if (isVisibleExternally(node2)) {
80802
+ error(node2.name, Diagnostics.The_type_of_this_declaration_is_ambiguous_and_may_be_observed_as_either_0_or_1, typeToString(widenedLiteralType), typeToString(type));
80803
+ }
80804
+ }
80805
+ });
80762
80806
  if (compilerOptions.importsNotUsedAsValues === 2 /* Error */ && !node.isDeclarationFile && isExternalModule(node)) {
80763
80807
  checkImportsForTypeOnlyConversion(node);
80764
80808
  }
@@ -80781,6 +80825,9 @@ function createTypeChecker(host) {
80781
80825
  forEach(potentialReflectCollisions, checkReflectCollision);
80782
80826
  clear(potentialReflectCollisions);
80783
80827
  }
80828
+ if (ambiguousVariableDeclarationsWhenWidened.length) {
80829
+ clear(ambiguousVariableDeclarationsWhenWidened);
80830
+ }
80784
80831
  links.flags |= 1 /* TypeChecked */;
80785
80832
  }
80786
80833
  }
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.3";
2333
- var version = `${versionMajorMinor}.0-insiders.20230927`;
2333
+ var version = `${versionMajorMinor}.0-insiders.20230928`;
2334
2334
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2335
2335
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2336
2336
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8357,11 +8357,12 @@ var sys = (() => {
8357
8357
  let activeSession;
8358
8358
  let profilePath = "./profile.cpuprofile";
8359
8359
  const Buffer2 = require("buffer").Buffer;
8360
- const isWindows = process.platform === "win32";
8360
+ const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
8361
+ const platform = _os.platform();
8361
8362
  const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
8362
- const fsRealpath = !!_fs.realpathSync.native ? isWindows ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
8363
+ const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
8363
8364
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
8364
- const fsSupportsRecursiveFsWatch = isWindows || process.platform === "darwin";
8365
+ const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
8365
8366
  const getCurrentDirectory = memoize(() => process.cwd());
8366
8367
  const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
8367
8368
  pollingWatchFileWorker: fsWatchFileWorker,
@@ -8380,7 +8381,7 @@ var sys = (() => {
8380
8381
  tscWatchFile: process.env.TSC_WATCHFILE,
8381
8382
  useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
8382
8383
  tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
8383
- inodeWatching: !isWindows,
8384
+ inodeWatching: isLinuxOrMacOs,
8384
8385
  sysLog
8385
8386
  });
8386
8387
  const nodeSystem = {
@@ -8565,7 +8566,7 @@ var sys = (() => {
8565
8566
  return Buffer2.from && Buffer2.from !== Int8Array.from ? Buffer2.from(input, encoding) : new Buffer2(input, encoding);
8566
8567
  }
8567
8568
  function isFileSystemCaseSensitive() {
8568
- if (isWindows) {
8569
+ if (platform === "win32" || platform === "win64") {
8569
8570
  return false;
8570
8571
  }
8571
8572
  return !fileExists(swapCase(__filename));
@@ -10180,6 +10181,7 @@ var Diagnostics = {
10180
10181
  Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
10181
10182
  Import_attribute_values_must_be_string_literal_expressions: diag(2858, 1 /* Error */, "Import_attribute_values_must_be_string_literal_expressions_2858", "Import attribute values must be string literal expressions."),
10182
10183
  Excessive_complexity_comparing_types_0_and_1: diag(2859, 1 /* Error */, "Excessive_complexity_comparing_types_0_and_1_2859", "Excessive complexity comparing types '{0}' and '{1}'."),
10184
+ The_type_of_this_declaration_is_ambiguous_and_may_be_observed_as_either_0_or_1: diag(2860, 1 /* Error */, "The_type_of_this_declaration_is_ambiguous_and_may_be_observed_as_either_0_or_1_2860", "The type of this declaration is ambiguous and may be observed as either '{0}' or '{1}'."),
10183
10185
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
10184
10186
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
10185
10187
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -48781,6 +48783,7 @@ function createTypeChecker(host) {
48781
48783
  var potentialReflectCollisions = [];
48782
48784
  var potentialUnusedRenamedBindingElementsInTypes = [];
48783
48785
  var awaitedTypeStack = [];
48786
+ var ambiguousVariableDeclarationsWhenWidened = [];
48784
48787
  var diagnostics = createDiagnosticCollection();
48785
48788
  var suggestionDiagnostics = createDiagnosticCollection();
48786
48789
  var typeofType = createTypeofType();
@@ -82240,6 +82243,29 @@ function createTypeChecker(host) {
82240
82243
  }
82241
82244
  checkCollisionsForDeclarationName(node, node.name);
82242
82245
  }
82246
+ function canHaveLiteralInitializer2(node2) {
82247
+ switch (node2.kind) {
82248
+ case 172 /* PropertyDeclaration */:
82249
+ case 171 /* PropertySignature */:
82250
+ return !hasEffectiveModifier(node2, 8 /* Private */);
82251
+ case 169 /* Parameter */:
82252
+ case 260 /* VariableDeclaration */:
82253
+ return true;
82254
+ }
82255
+ return false;
82256
+ }
82257
+ function shouldPrintWithInitializer(node2) {
82258
+ return canHaveLiteralInitializer2(node2) && isLiteralConstDeclaration(node2);
82259
+ }
82260
+ function isPrivateDeclaration(node2) {
82261
+ return hasEffectiveModifier(node2, 8 /* Private */) || isPrivateIdentifierClassElementDeclaration(node2);
82262
+ }
82263
+ if (getEmitDeclarations(compilerOptions) && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) && !shouldPrintWithInitializer(node) && !isPrivateDeclaration(node)) {
82264
+ const widenedLiteralType = getWidenedLiteralType(type);
82265
+ if (!isTypeIdenticalTo(type, widenedLiteralType)) {
82266
+ ambiguousVariableDeclarationsWhenWidened.push([node, type, widenedLiteralType]);
82267
+ }
82268
+ }
82243
82269
  }
82244
82270
  function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) {
82245
82271
  const nextDeclarationName = getNameOfDeclaration(nextDeclaration);
@@ -85455,6 +85481,7 @@ function createTypeChecker(host) {
85455
85481
  clear(potentialWeakMapSetCollisions);
85456
85482
  clear(potentialReflectCollisions);
85457
85483
  clear(potentialUnusedRenamedBindingElementsInTypes);
85484
+ clear(ambiguousVariableDeclarationsWhenWidened);
85458
85485
  forEach(node.statements, checkSourceElement);
85459
85486
  checkSourceElement(node.endOfFileToken);
85460
85487
  checkDeferredNodes(node);
@@ -85473,6 +85500,23 @@ function createTypeChecker(host) {
85473
85500
  checkPotentialUncheckedRenamedBindingElementsInTypes();
85474
85501
  }
85475
85502
  });
85503
+ addLazyDiagnostic(() => {
85504
+ function isVisibleExternally(elem) {
85505
+ if (isOmittedExpression(elem)) {
85506
+ return false;
85507
+ }
85508
+ if (isBindingPattern(elem.name)) {
85509
+ return some(elem.name.elements, isVisibleExternally);
85510
+ } else {
85511
+ return isDeclarationVisible(elem);
85512
+ }
85513
+ }
85514
+ for (const [node2, type, widenedLiteralType] of ambiguousVariableDeclarationsWhenWidened) {
85515
+ if (isVisibleExternally(node2)) {
85516
+ error2(node2.name, Diagnostics.The_type_of_this_declaration_is_ambiguous_and_may_be_observed_as_either_0_or_1, typeToString(widenedLiteralType), typeToString(type));
85517
+ }
85518
+ }
85519
+ });
85476
85520
  if (compilerOptions.importsNotUsedAsValues === 2 /* Error */ && !node.isDeclarationFile && isExternalModule(node)) {
85477
85521
  checkImportsForTypeOnlyConversion(node);
85478
85522
  }
@@ -85495,6 +85539,9 @@ function createTypeChecker(host) {
85495
85539
  forEach(potentialReflectCollisions, checkReflectCollision);
85496
85540
  clear(potentialReflectCollisions);
85497
85541
  }
85542
+ if (ambiguousVariableDeclarationsWhenWidened.length) {
85543
+ clear(ambiguousVariableDeclarationsWhenWidened);
85544
+ }
85498
85545
  links.flags |= 1 /* TypeChecked */;
85499
85546
  }
85500
85547
  }
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.3";
38
- version = `${versionMajorMinor}.0-insiders.20230927`;
38
+ version = `${versionMajorMinor}.0-insiders.20230928`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6126,11 +6126,12 @@ ${lanes.join("\n")}
6126
6126
  let activeSession;
6127
6127
  let profilePath = "./profile.cpuprofile";
6128
6128
  const Buffer2 = require("buffer").Buffer;
6129
- const isWindows = process.platform === "win32";
6129
+ const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
6130
+ const platform = _os.platform();
6130
6131
  const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
6131
- const fsRealpath = !!_fs.realpathSync.native ? isWindows ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
6132
+ const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
6132
6133
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
6133
- const fsSupportsRecursiveFsWatch = isWindows || process.platform === "darwin";
6134
+ const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
6134
6135
  const getCurrentDirectory = memoize(() => process.cwd());
6135
6136
  const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
6136
6137
  pollingWatchFileWorker: fsWatchFileWorker,
@@ -6149,7 +6150,7 @@ ${lanes.join("\n")}
6149
6150
  tscWatchFile: process.env.TSC_WATCHFILE,
6150
6151
  useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
6151
6152
  tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
6152
- inodeWatching: !isWindows,
6153
+ inodeWatching: isLinuxOrMacOs,
6153
6154
  sysLog
6154
6155
  });
6155
6156
  const nodeSystem = {
@@ -6334,7 +6335,7 @@ ${lanes.join("\n")}
6334
6335
  return Buffer2.from && Buffer2.from !== Int8Array.from ? Buffer2.from(input, encoding) : new Buffer2(input, encoding);
6335
6336
  }
6336
6337
  function isFileSystemCaseSensitive() {
6337
- if (isWindows) {
6338
+ if (platform === "win32" || platform === "win64") {
6338
6339
  return false;
6339
6340
  }
6340
6341
  return !fileExists(swapCase(__filename));
@@ -7960,6 +7961,7 @@ ${lanes.join("\n")}
7960
7961
  Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
7961
7962
  Import_attribute_values_must_be_string_literal_expressions: diag(2858, 1 /* Error */, "Import_attribute_values_must_be_string_literal_expressions_2858", "Import attribute values must be string literal expressions."),
7962
7963
  Excessive_complexity_comparing_types_0_and_1: diag(2859, 1 /* Error */, "Excessive_complexity_comparing_types_0_and_1_2859", "Excessive complexity comparing types '{0}' and '{1}'."),
7964
+ The_type_of_this_declaration_is_ambiguous_and_may_be_observed_as_either_0_or_1: diag(2860, 1 /* Error */, "The_type_of_this_declaration_is_ambiguous_and_may_be_observed_as_either_0_or_1_2860", "The type of this declaration is ambiguous and may be observed as either '{0}' or '{1}'."),
7963
7965
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
7964
7966
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
7965
7967
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -46545,6 +46547,7 @@ ${lanes.join("\n")}
46545
46547
  var potentialReflectCollisions = [];
46546
46548
  var potentialUnusedRenamedBindingElementsInTypes = [];
46547
46549
  var awaitedTypeStack = [];
46550
+ var ambiguousVariableDeclarationsWhenWidened = [];
46548
46551
  var diagnostics = createDiagnosticCollection();
46549
46552
  var suggestionDiagnostics = createDiagnosticCollection();
46550
46553
  var typeofType = createTypeofType();
@@ -80004,6 +80007,29 @@ ${lanes.join("\n")}
80004
80007
  }
80005
80008
  checkCollisionsForDeclarationName(node, node.name);
80006
80009
  }
80010
+ function canHaveLiteralInitializer2(node2) {
80011
+ switch (node2.kind) {
80012
+ case 172 /* PropertyDeclaration */:
80013
+ case 171 /* PropertySignature */:
80014
+ return !hasEffectiveModifier(node2, 8 /* Private */);
80015
+ case 169 /* Parameter */:
80016
+ case 260 /* VariableDeclaration */:
80017
+ return true;
80018
+ }
80019
+ return false;
80020
+ }
80021
+ function shouldPrintWithInitializer(node2) {
80022
+ return canHaveLiteralInitializer2(node2) && isLiteralConstDeclaration(node2);
80023
+ }
80024
+ function isPrivateDeclaration(node2) {
80025
+ return hasEffectiveModifier(node2, 8 /* Private */) || isPrivateIdentifierClassElementDeclaration(node2);
80026
+ }
80027
+ if (getEmitDeclarations(compilerOptions) && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) && !shouldPrintWithInitializer(node) && !isPrivateDeclaration(node)) {
80028
+ const widenedLiteralType = getWidenedLiteralType(type);
80029
+ if (!isTypeIdenticalTo(type, widenedLiteralType)) {
80030
+ ambiguousVariableDeclarationsWhenWidened.push([node, type, widenedLiteralType]);
80031
+ }
80032
+ }
80007
80033
  }
80008
80034
  function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) {
80009
80035
  const nextDeclarationName = getNameOfDeclaration(nextDeclaration);
@@ -83219,6 +83245,7 @@ ${lanes.join("\n")}
83219
83245
  clear(potentialWeakMapSetCollisions);
83220
83246
  clear(potentialReflectCollisions);
83221
83247
  clear(potentialUnusedRenamedBindingElementsInTypes);
83248
+ clear(ambiguousVariableDeclarationsWhenWidened);
83222
83249
  forEach(node.statements, checkSourceElement);
83223
83250
  checkSourceElement(node.endOfFileToken);
83224
83251
  checkDeferredNodes(node);
@@ -83237,6 +83264,23 @@ ${lanes.join("\n")}
83237
83264
  checkPotentialUncheckedRenamedBindingElementsInTypes();
83238
83265
  }
83239
83266
  });
83267
+ addLazyDiagnostic(() => {
83268
+ function isVisibleExternally(elem) {
83269
+ if (isOmittedExpression(elem)) {
83270
+ return false;
83271
+ }
83272
+ if (isBindingPattern(elem.name)) {
83273
+ return some(elem.name.elements, isVisibleExternally);
83274
+ } else {
83275
+ return isDeclarationVisible(elem);
83276
+ }
83277
+ }
83278
+ for (const [node2, type, widenedLiteralType] of ambiguousVariableDeclarationsWhenWidened) {
83279
+ if (isVisibleExternally(node2)) {
83280
+ error2(node2.name, Diagnostics.The_type_of_this_declaration_is_ambiguous_and_may_be_observed_as_either_0_or_1, typeToString(widenedLiteralType), typeToString(type));
83281
+ }
83282
+ }
83283
+ });
83240
83284
  if (compilerOptions.importsNotUsedAsValues === 2 /* Error */ && !node.isDeclarationFile && isExternalModule(node)) {
83241
83285
  checkImportsForTypeOnlyConversion(node);
83242
83286
  }
@@ -83259,6 +83303,9 @@ ${lanes.join("\n")}
83259
83303
  forEach(potentialReflectCollisions, checkReflectCollision);
83260
83304
  clear(potentialReflectCollisions);
83261
83305
  }
83306
+ if (ambiguousVariableDeclarationsWhenWidened.length) {
83307
+ clear(ambiguousVariableDeclarationsWhenWidened);
83308
+ }
83262
83309
  links.flags |= 1 /* TypeChecked */;
83263
83310
  }
83264
83311
  }
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.3";
57
- var version = `${versionMajorMinor}.0-insiders.20230927`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230928`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -4252,11 +4252,12 @@ var sys = (() => {
4252
4252
  let activeSession;
4253
4253
  let profilePath = "./profile.cpuprofile";
4254
4254
  const Buffer2 = require("buffer").Buffer;
4255
- const isWindows = process.platform === "win32";
4255
+ const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
4256
+ const platform = _os.platform();
4256
4257
  const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
4257
- const fsRealpath = !!_fs.realpathSync.native ? isWindows ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
4258
+ const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
4258
4259
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
4259
- const fsSupportsRecursiveFsWatch = isWindows || process.platform === "darwin";
4260
+ const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
4260
4261
  const getCurrentDirectory = memoize(() => process.cwd());
4261
4262
  const { watchFile, watchDirectory } = createSystemWatchFunctions({
4262
4263
  pollingWatchFileWorker: fsWatchFileWorker,
@@ -4275,7 +4276,7 @@ var sys = (() => {
4275
4276
  tscWatchFile: process.env.TSC_WATCHFILE,
4276
4277
  useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
4277
4278
  tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
4278
- inodeWatching: !isWindows,
4279
+ inodeWatching: isLinuxOrMacOs,
4279
4280
  sysLog
4280
4281
  });
4281
4282
  const nodeSystem = {
@@ -4460,7 +4461,7 @@ var sys = (() => {
4460
4461
  return Buffer2.from && Buffer2.from !== Int8Array.from ? Buffer2.from(input, encoding) : new Buffer2(input, encoding);
4461
4462
  }
4462
4463
  function isFileSystemCaseSensitive() {
4463
- if (isWindows) {
4464
+ if (platform === "win32" || platform === "win64") {
4464
4465
  return false;
4465
4466
  }
4466
4467
  return !fileExists(swapCase(__filename));
@@ -6027,6 +6028,7 @@ var Diagnostics = {
6027
6028
  Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
6028
6029
  Import_attribute_values_must_be_string_literal_expressions: diag(2858, 1 /* Error */, "Import_attribute_values_must_be_string_literal_expressions_2858", "Import attribute values must be string literal expressions."),
6029
6030
  Excessive_complexity_comparing_types_0_and_1: diag(2859, 1 /* Error */, "Excessive_complexity_comparing_types_0_and_1_2859", "Excessive complexity comparing types '{0}' and '{1}'."),
6031
+ The_type_of_this_declaration_is_ambiguous_and_may_be_observed_as_either_0_or_1: diag(2860, 1 /* Error */, "The_type_of_this_declaration_is_ambiguous_and_may_be_observed_as_either_0_or_1_2860", "The type of this declaration is ambiguous and may be observed as either '{0}' or '{1}'."),
6030
6032
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
6031
6033
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
6032
6034
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
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.3.0-pr-55567-5",
5
+ "version": "5.3.0-pr-55860-30",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "20.1.0",
115
115
  "npm": "8.19.4"
116
116
  },
117
- "gitHead": "65334d3e757bf0f013f0bd9cca47faebbe411fac"
117
+ "gitHead": "c7b225f75ae6c946cd97ab7bc95c0929e5bf7282"
118
118
  }