@typescript-deploys/pr-build 5.1.0-pr-52840-4 → 5.1.0-pr-53607-12

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.1";
21
- var version = `${versionMajorMinor}.0-insiders.20230328`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230331`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -4076,7 +4076,7 @@ function createDynamicPriorityPollingWatchFile(host) {
4076
4076
  queue.pollScheduled = false;
4077
4077
  return queue;
4078
4078
  }
4079
- function pollPollingIntervalQueue(queue) {
4079
+ function pollPollingIntervalQueue(_timeoutType, queue) {
4080
4080
  queue.pollIndex = pollQueue(queue, queue.pollingInterval, queue.pollIndex, pollingChunkSize[queue.pollingInterval]);
4081
4081
  if (queue.length) {
4082
4082
  scheduleNextPoll(queue.pollingInterval);
@@ -4085,7 +4085,7 @@ function createDynamicPriorityPollingWatchFile(host) {
4085
4085
  queue.pollScheduled = false;
4086
4086
  }
4087
4087
  }
4088
- function pollLowPollingIntervalQueue(queue) {
4088
+ function pollLowPollingIntervalQueue(_timeoutType, queue) {
4089
4089
  pollQueue(
4090
4090
  changedFilesInLastPoll,
4091
4091
  250 /* Low */,
@@ -4093,7 +4093,7 @@ function createDynamicPriorityPollingWatchFile(host) {
4093
4093
  0,
4094
4094
  changedFilesInLastPoll.length
4095
4095
  );
4096
- pollPollingIntervalQueue(queue);
4096
+ pollPollingIntervalQueue(_timeoutType, queue);
4097
4097
  if (!queue.pollScheduled && changedFilesInLastPoll.length) {
4098
4098
  scheduleNextPoll(250 /* Low */);
4099
4099
  }
@@ -4150,7 +4150,7 @@ function createDynamicPriorityPollingWatchFile(host) {
4150
4150
  }
4151
4151
  }
4152
4152
  function scheduleNextPoll(pollingInterval) {
4153
- pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval));
4153
+ pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
4154
4154
  }
4155
4155
  }
4156
4156
  function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) {
@@ -4229,7 +4229,7 @@ function createFixedChunkSizePollingWatchFile(host) {
4229
4229
  function scheduleNextPoll() {
4230
4230
  if (!watchedFiles.length || pollScheduled)
4231
4231
  return;
4232
- pollScheduled = host.setTimeout(pollQueue, 2e3 /* High */);
4232
+ pollScheduled = host.setTimeout(pollQueue, 2e3 /* High */, "pollQueue");
4233
4233
  }
4234
4234
  }
4235
4235
  function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) {
@@ -4397,7 +4397,7 @@ function createDirectoryWatcherSupportingRecursive({
4397
4397
  clearTimeout2(timerToUpdateChildWatches);
4398
4398
  timerToUpdateChildWatches = void 0;
4399
4399
  }
4400
- timerToUpdateChildWatches = setTimeout2(onTimerToUpdateChildWatches, 1e3);
4400
+ timerToUpdateChildWatches = setTimeout2(onTimerToUpdateChildWatches, 1e3, "timerToUpdateChildWatches");
4401
4401
  }
4402
4402
  function onTimerToUpdateChildWatches() {
4403
4403
  timerToUpdateChildWatches = void 0;
@@ -6193,7 +6193,7 @@ var Diagnostics = {
6193
6193
  Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first: diag(2352, 1 /* Error */, "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352", "Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."),
6194
6194
  Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: diag(2353, 1 /* Error */, "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),
6195
6195
  This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: diag(2354, 1 /* Error */, "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", "This syntax requires an imported helper but module '{0}' cannot be found."),
6196
- A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: diag(2355, 1 /* Error */, "A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355", "A function whose declared type is neither 'void' nor 'any' must return a value."),
6196
+ A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value: diag(2355, 1 /* Error */, "A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value_2355", "A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value."),
6197
6197
  An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2356, 1 /* Error */, "An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356", "An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),
6198
6198
  The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, 1 /* Error */, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."),
6199
6199
  The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, 1 /* Error */, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),
@@ -6216,7 +6216,6 @@ var Diagnostics = {
6216
6216
  Constructors_for_derived_classes_must_contain_a_super_call: diag(2377, 1 /* Error */, "Constructors_for_derived_classes_must_contain_a_super_call_2377", "Constructors for derived classes must contain a 'super' call."),
6217
6217
  A_get_accessor_must_return_a_value: diag(2378, 1 /* Error */, "A_get_accessor_must_return_a_value_2378", "A 'get' accessor must return a value."),
6218
6218
  Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2379, 1 /* Error */, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379", "Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),
6219
- The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type: diag(2380, 1 /* Error */, "The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type_2380", "The return type of a 'get' accessor must be assignable to its 'set' accessor type"),
6220
6219
  Overload_signatures_must_all_be_exported_or_non_exported: diag(2383, 1 /* Error */, "Overload_signatures_must_all_be_exported_or_non_exported_2383", "Overload signatures must all be exported or non-exported."),
6221
6220
  Overload_signatures_must_all_be_ambient_or_non_ambient: diag(2384, 1 /* Error */, "Overload_signatures_must_all_be_ambient_or_non_ambient_2384", "Overload signatures must all be ambient or non-ambient."),
6222
6221
  Overload_signatures_must_all_be_public_private_or_protected: diag(2385, 1 /* Error */, "Overload_signatures_must_all_be_public_private_or_protected_2385", "Overload signatures must all be public, private or protected."),
@@ -6634,7 +6633,6 @@ var Diagnostics = {
6634
6633
  Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, 1 /* Error */, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
6635
6634
  This_condition_will_always_return_0: diag(2845, 1 /* Error */, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."),
6636
6635
  A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead: diag(2846, 1 /* Error */, "A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_f_2846", "A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '{0}' instead?"),
6637
- A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value: diag(2847, 1 /* Error */, "A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value_2847", "A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value."),
6638
6636
  The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression: diag(2848, 1 /* Error */, "The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression_2848", "The right-hand side of an 'instanceof' expression must not be an instantiation expression."),
6639
6637
  Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1: diag(2849, 1 /* Error */, "Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1_2849", "Target signature provides too few arguments. Expected {0} or more, but got {1}."),
6640
6638
  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}'."),
@@ -34132,7 +34130,8 @@ var commandOptionsWithoutBuild = [
34132
34130
  affectsBuildInfo: true,
34133
34131
  category: Diagnostics.Modules,
34134
34132
  description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
34135
- defaultValueDescription: false
34133
+ defaultValueDescription: false,
34134
+ transpileOptionValue: void 0
34136
34135
  },
34137
34136
  {
34138
34137
  name: "resolvePackageJsonExports",
@@ -72013,7 +72012,16 @@ function createTypeChecker(host) {
72013
72012
  return functionFlags & 2 /* Async */ ? createPromiseReturnType(func, neverType) : neverType;
72014
72013
  }
72015
72014
  if (types.length === 0) {
72016
- return functionFlags & 2 /* Async */ ? createPromiseReturnType(func, voidType) : voidType;
72015
+ const contextualReturnType = getContextualReturnType(
72016
+ func,
72017
+ /*contextFlags*/
72018
+ void 0
72019
+ );
72020
+ const returnType2 = contextualReturnType && (unwrapReturnType(contextualReturnType, functionFlags) || voidType).flags & 32768 /* Undefined */ ? undefinedType : voidType;
72021
+ return functionFlags & 2 /* Async */ ? createPromiseReturnType(func, returnType2) : (
72022
+ // Async function
72023
+ returnType2
72024
+ );
72017
72025
  }
72018
72026
  returnType = getUnionType(types, 2 /* Subtype */);
72019
72027
  }
@@ -72235,7 +72243,7 @@ function createTypeChecker(host) {
72235
72243
  function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
72236
72244
  const functionFlags = getFunctionFlags(func);
72237
72245
  const type = returnType && unwrapReturnType(returnType, functionFlags);
72238
- if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */ | 2 /* Unknown */)) {
72246
+ if (type && (maybeTypeOfKind(type, 16384 /* Void */) || type.flags & (1 /* Any */ | 32768 /* Undefined */))) {
72239
72247
  return;
72240
72248
  }
72241
72249
  if (func.kind === 171 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 239 /* Block */ || !functionHasImplicitReturn(func)) {
@@ -72246,12 +72254,8 @@ function createTypeChecker(host) {
72246
72254
  if (type && type.flags & 131072 /* Never */) {
72247
72255
  error(errorNode, Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point);
72248
72256
  } else if (type && !hasExplicitReturn) {
72249
- if (strictNullChecks) {
72250
- error(errorNode, Diagnostics.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value);
72251
- } else {
72252
- error(errorNode, Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value);
72253
- }
72254
- } else if (type && strictNullChecks) {
72257
+ error(errorNode, Diagnostics.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value);
72258
+ } else if (type && strictNullChecks && !isTypeAssignableTo(undefinedType, type)) {
72255
72259
  error(errorNode, Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);
72256
72260
  } else if (compilerOptions.noImplicitReturns) {
72257
72261
  if (!type) {
@@ -72259,7 +72263,7 @@ function createTypeChecker(host) {
72259
72263
  return;
72260
72264
  }
72261
72265
  const inferredReturnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func));
72262
- if (isUnwrappedReturnTypeVoidOrAny(func, inferredReturnType)) {
72266
+ if (isUnwrappedReturnTypeUndefinedVoidAnyOrUnknown(func, inferredReturnType)) {
72263
72267
  return;
72264
72268
  }
72265
72269
  }
@@ -74642,11 +74646,6 @@ function createTypeChecker(host) {
74642
74646
  error(getter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
74643
74647
  error(setter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter);
74644
74648
  }
74645
- const getterType = getAnnotatedAccessorType(getter);
74646
- const setterType = getAnnotatedAccessorType(setter);
74647
- if (getterType && setterType) {
74648
- checkTypeAssignableTo(getterType, setterType, getter, Diagnostics.The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type);
74649
- }
74650
74649
  }
74651
74650
  }
74652
74651
  const returnType = getTypeOfAccessors(getSymbolOfDeclaration(node));
@@ -77417,9 +77416,9 @@ function createTypeChecker(host) {
77417
77416
  }
77418
77417
  return isAsync ? getAwaitedTypeNoAlias(returnType) || errorType : returnType;
77419
77418
  }
77420
- function isUnwrappedReturnTypeVoidOrAny(func, returnType) {
77419
+ function isUnwrappedReturnTypeUndefinedVoidAnyOrUnknown(func, returnType) {
77421
77420
  const unwrappedReturnType = unwrapReturnType(returnType, getFunctionFlags(func));
77422
- return !!unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 16384 /* Void */ | 3 /* AnyOrUnknown */);
77421
+ return !!unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 32768 /* Undefined */ | 16384 /* Void */ | 3 /* AnyOrUnknown */);
77423
77422
  }
77424
77423
  function checkReturnStatement(node) {
77425
77424
  var _a2;
@@ -77461,7 +77460,7 @@ function createTypeChecker(host) {
77461
77460
  checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression);
77462
77461
  }
77463
77462
  }
77464
- } else if (container.kind !== 174 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
77463
+ } else if (container.kind !== 174 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidAnyOrUnknown(container, returnType)) {
77465
77464
  error(node, Diagnostics.Not_all_code_paths_return_a_value);
77466
77465
  }
77467
77466
  }
@@ -119924,7 +119923,7 @@ function createWatchProgram(host) {
119924
119923
  }
119925
119924
  const pending = clearInvalidateResolutionsOfFailedLookupLocations();
119926
119925
  writeLog(`Scheduling invalidateFailedLookup${pending ? ", Cancelled earlier one" : ""}`);
119927
- timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
119926
+ timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250, "timerToInvalidateFailedLookupResolutions");
119928
119927
  }
119929
119928
  function invalidateResolutionsOfFailedLookup() {
119930
119929
  timerToInvalidateFailedLookupResolutions = void 0;
@@ -119940,7 +119939,7 @@ function createWatchProgram(host) {
119940
119939
  host.clearTimeout(timerToUpdateProgram);
119941
119940
  }
119942
119941
  writeLog("Scheduling update");
119943
- timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250);
119942
+ timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250, "timerToUpdateProgram");
119944
119943
  }
119945
119944
  function scheduleProgramReload() {
119946
119945
  Debug.assert(!!configFileName);
@@ -121818,9 +121817,9 @@ function scheduleBuildInvalidatedProject(state, time, changeDetected) {
121818
121817
  if (state.timerToBuildInvalidatedProject) {
121819
121818
  hostWithWatch.clearTimeout(state.timerToBuildInvalidatedProject);
121820
121819
  }
121821
- state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, time, state, changeDetected);
121820
+ state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, time, "timerToBuildInvalidatedProject", state, changeDetected);
121822
121821
  }
121823
- function buildNextInvalidatedProject(state, changeDetected) {
121822
+ function buildNextInvalidatedProject(_timeoutType, state, changeDetected) {
121824
121823
  mark("SolutionBuilder::beforeBuild");
121825
121824
  const buildOrder = buildNextInvalidatedProjectWorker(state, changeDetected);
121826
121825
  mark("SolutionBuilder::afterBuild");