typescript 5.0.0-dev.20221101 → 5.0.0-dev.20221103

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
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "5.0";
72
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
72
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221103");
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -42271,7 +42271,7 @@ var ts;
42271
42271
  }
42272
42272
  function isSameScopeDescendentOf(initial, parent, stopAt) {
42273
42273
  return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
42274
- || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
42274
+ || (n === stopAt || ts.isFunctionLike(n) && (!ts.getImmediatelyInvokedFunctionExpression(n) || ts.isAsyncFunction(n)) ? "quit" : false); });
42275
42275
  }
42276
42276
  function getAnyImportSyntax(node) {
42277
42277
  switch (node.kind) {
@@ -56670,28 +56670,32 @@ var ts;
56670
56670
  }
56671
56671
  var sourceTypeArguments = getTypeArguments(source);
56672
56672
  var targetTypeArguments = getTypeArguments(target);
56673
- var startCount = Math.min(isTupleType(source) ? getStartElementCount(source.target, 11) : 0, getStartElementCount(target.target, 11));
56674
- var endCount = Math.min(isTupleType(source) ? getEndElementCount(source.target, 11) : 0, targetRestFlag ? getEndElementCount(target.target, 11) : 0);
56673
+ var targetStartCount = getStartElementCount(target.target, 11);
56674
+ var targetEndCount = getEndElementCount(target.target, 11);
56675
+ var targetHasRestElement = target.target.hasRestElement;
56675
56676
  var canExcludeDiscriminants = !!excludedProperties;
56676
- for (var i = 0; i < targetArity; i++) {
56677
- var sourceIndex = i < targetArity - endCount ? i : i + sourceArity - targetArity;
56678
- var sourceFlags = isTupleType(source) && (i < startCount || i >= targetArity - endCount) ? source.target.elementFlags[sourceIndex] : 4;
56679
- var targetFlags = target.target.elementFlags[i];
56677
+ for (var sourcePosition = 0; sourcePosition < sourceArity; sourcePosition++) {
56678
+ var sourceFlags = isTupleType(source) ? source.target.elementFlags[sourcePosition] : 4;
56679
+ var sourcePositionFromEnd = sourceArity - 1 - sourcePosition;
56680
+ var targetPosition = targetHasRestElement && sourcePosition >= targetStartCount
56681
+ ? targetArity - 1 - Math.min(sourcePositionFromEnd, targetEndCount)
56682
+ : sourcePosition;
56683
+ var targetFlags = target.target.elementFlags[targetPosition];
56680
56684
  if (targetFlags & 8 && !(sourceFlags & 8)) {
56681
56685
  if (reportErrors) {
56682
- reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, i);
56686
+ reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, targetPosition);
56683
56687
  }
56684
56688
  return 0;
56685
56689
  }
56686
56690
  if (sourceFlags & 8 && !(targetFlags & 12)) {
56687
56691
  if (reportErrors) {
56688
- reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourceIndex, i);
56692
+ reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourcePosition, targetPosition);
56689
56693
  }
56690
56694
  return 0;
56691
56695
  }
56692
56696
  if (targetFlags & 1 && !(sourceFlags & 1)) {
56693
56697
  if (reportErrors) {
56694
- reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, i);
56698
+ reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, targetPosition);
56695
56699
  }
56696
56700
  return 0;
56697
56701
  }
@@ -56699,24 +56703,22 @@ var ts;
56699
56703
  if (sourceFlags & 12 || targetFlags & 12) {
56700
56704
  canExcludeDiscriminants = false;
56701
56705
  }
56702
- if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + i)))) {
56706
+ if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + sourcePosition)))) {
56703
56707
  continue;
56704
56708
  }
56705
56709
  }
56706
- var sourceType = !isTupleType(source) ? sourceTypeArguments[0] :
56707
- i < startCount || i >= targetArity - endCount ? removeMissingType(sourceTypeArguments[sourceIndex], !!(sourceFlags & targetFlags & 2)) :
56708
- getElementTypeOfSliceOfTupleType(source, startCount, endCount) || neverType;
56709
- var targetType = targetTypeArguments[i];
56710
+ var sourceType = removeMissingType(sourceTypeArguments[sourcePosition], !!(sourceFlags & targetFlags & 2));
56711
+ var targetType = targetTypeArguments[targetPosition];
56710
56712
  var targetCheckType = sourceFlags & 8 && targetFlags & 4 ? createArrayType(targetType) :
56711
56713
  removeMissingType(targetType, !!(targetFlags & 2));
56712
56714
  var related = isRelatedTo(sourceType, targetCheckType, 3, reportErrors, undefined, intersectionState);
56713
56715
  if (!related) {
56714
56716
  if (reportErrors && (targetArity > 1 || sourceArity > 1)) {
56715
- if (i < startCount || i >= targetArity - endCount || sourceArity - startCount - endCount === 1) {
56716
- reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourceIndex, i);
56717
+ if (targetHasRestElement && sourcePosition >= targetStartCount && sourcePositionFromEnd >= targetEndCount && targetStartCount !== sourceArity - targetEndCount - 1) {
56718
+ reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, targetStartCount, sourceArity - targetEndCount - 1, targetPosition);
56717
56719
  }
56718
56720
  else {
56719
- reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, startCount, sourceArity - endCount - 1, i);
56721
+ reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourcePosition, targetPosition);
56720
56722
  }
56721
56723
  }
56722
56724
  return 0;
@@ -101964,7 +101966,7 @@ var ts;
101964
101966
  var seenEmittedFiles = (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map()));
101965
101967
  for (var i = state.affectedFilesPendingEmitIndex; i < affectedFilesPendingEmit.length; i++) {
101966
101968
  var affectedFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(affectedFilesPendingEmit[i]);
101967
- if (affectedFile) {
101969
+ if (affectedFile && ts.sourceFileMayBeEmitted(affectedFile, state.program)) {
101968
101970
  var seenKind = seenEmittedFiles.get(affectedFile.resolvedPath);
101969
101971
  var emitKind = ts.Debug.checkDefined(ts.Debug.checkDefined(state.affectedFilesPendingEmitKind).get(affectedFile.resolvedPath));
101970
101972
  if (seenKind === undefined || seenKind < emitKind) {
@@ -102231,6 +102233,9 @@ var ts;
102231
102233
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
102232
102234
  var path = _c[_b];
102233
102235
  if (ts.tryAddToSet(seenFiles, path)) {
102236
+ var file = state.program.getSourceFileByPath(path);
102237
+ if (!ts.sourceFileMayBeEmitted(file, state.program))
102238
+ continue;
102234
102239
  var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
102235
102240
  (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 ? fileId : [fileId]);
102236
102241
  }
package/lib/tsserver.js CHANGED
@@ -109,7 +109,7 @@ var ts;
109
109
  // The following is baselined as a literal template type without intervention
110
110
  /** The version of the TypeScript compiler release */
111
111
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
112
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
112
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221103");
113
113
  /* @internal */
114
114
  var Comparison;
115
115
  (function (Comparison) {
@@ -51407,7 +51407,7 @@ var ts;
51407
51407
  */
51408
51408
  function isSameScopeDescendentOf(initial, parent, stopAt) {
51409
51409
  return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
51410
- || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
51410
+ || (n === stopAt || ts.isFunctionLike(n) && (!ts.getImmediatelyInvokedFunctionExpression(n) || ts.isAsyncFunction(n)) ? "quit" : false); });
51411
51411
  }
51412
51412
  function getAnyImportSyntax(node) {
51413
51413
  switch (node.kind) {
@@ -67922,28 +67922,32 @@ var ts;
67922
67922
  }
67923
67923
  var sourceTypeArguments = getTypeArguments(source);
67924
67924
  var targetTypeArguments = getTypeArguments(target);
67925
- var startCount = Math.min(isTupleType(source) ? getStartElementCount(source.target, 11 /* ElementFlags.NonRest */) : 0, getStartElementCount(target.target, 11 /* ElementFlags.NonRest */));
67926
- var endCount = Math.min(isTupleType(source) ? getEndElementCount(source.target, 11 /* ElementFlags.NonRest */) : 0, targetRestFlag ? getEndElementCount(target.target, 11 /* ElementFlags.NonRest */) : 0);
67925
+ var targetStartCount = getStartElementCount(target.target, 11 /* ElementFlags.NonRest */);
67926
+ var targetEndCount = getEndElementCount(target.target, 11 /* ElementFlags.NonRest */);
67927
+ var targetHasRestElement = target.target.hasRestElement;
67927
67928
  var canExcludeDiscriminants = !!excludedProperties;
67928
- for (var i = 0; i < targetArity; i++) {
67929
- var sourceIndex = i < targetArity - endCount ? i : i + sourceArity - targetArity;
67930
- var sourceFlags = isTupleType(source) && (i < startCount || i >= targetArity - endCount) ? source.target.elementFlags[sourceIndex] : 4 /* ElementFlags.Rest */;
67931
- var targetFlags = target.target.elementFlags[i];
67929
+ for (var sourcePosition = 0; sourcePosition < sourceArity; sourcePosition++) {
67930
+ var sourceFlags = isTupleType(source) ? source.target.elementFlags[sourcePosition] : 4 /* ElementFlags.Rest */;
67931
+ var sourcePositionFromEnd = sourceArity - 1 - sourcePosition;
67932
+ var targetPosition = targetHasRestElement && sourcePosition >= targetStartCount
67933
+ ? targetArity - 1 - Math.min(sourcePositionFromEnd, targetEndCount)
67934
+ : sourcePosition;
67935
+ var targetFlags = target.target.elementFlags[targetPosition];
67932
67936
  if (targetFlags & 8 /* ElementFlags.Variadic */ && !(sourceFlags & 8 /* ElementFlags.Variadic */)) {
67933
67937
  if (reportErrors) {
67934
- reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, i);
67938
+ reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, targetPosition);
67935
67939
  }
67936
67940
  return 0 /* Ternary.False */;
67937
67941
  }
67938
67942
  if (sourceFlags & 8 /* ElementFlags.Variadic */ && !(targetFlags & 12 /* ElementFlags.Variable */)) {
67939
67943
  if (reportErrors) {
67940
- reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourceIndex, i);
67944
+ reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourcePosition, targetPosition);
67941
67945
  }
67942
67946
  return 0 /* Ternary.False */;
67943
67947
  }
67944
67948
  if (targetFlags & 1 /* ElementFlags.Required */ && !(sourceFlags & 1 /* ElementFlags.Required */)) {
67945
67949
  if (reportErrors) {
67946
- reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, i);
67950
+ reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, targetPosition);
67947
67951
  }
67948
67952
  return 0 /* Ternary.False */;
67949
67953
  }
@@ -67952,24 +67956,22 @@ var ts;
67952
67956
  if (sourceFlags & 12 /* ElementFlags.Variable */ || targetFlags & 12 /* ElementFlags.Variable */) {
67953
67957
  canExcludeDiscriminants = false;
67954
67958
  }
67955
- if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + i)))) {
67959
+ if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + sourcePosition)))) {
67956
67960
  continue;
67957
67961
  }
67958
67962
  }
67959
- var sourceType = !isTupleType(source) ? sourceTypeArguments[0] :
67960
- i < startCount || i >= targetArity - endCount ? removeMissingType(sourceTypeArguments[sourceIndex], !!(sourceFlags & targetFlags & 2 /* ElementFlags.Optional */)) :
67961
- getElementTypeOfSliceOfTupleType(source, startCount, endCount) || neverType;
67962
- var targetType = targetTypeArguments[i];
67963
+ var sourceType = removeMissingType(sourceTypeArguments[sourcePosition], !!(sourceFlags & targetFlags & 2 /* ElementFlags.Optional */));
67964
+ var targetType = targetTypeArguments[targetPosition];
67963
67965
  var targetCheckType = sourceFlags & 8 /* ElementFlags.Variadic */ && targetFlags & 4 /* ElementFlags.Rest */ ? createArrayType(targetType) :
67964
67966
  removeMissingType(targetType, !!(targetFlags & 2 /* ElementFlags.Optional */));
67965
67967
  var related = isRelatedTo(sourceType, targetCheckType, 3 /* RecursionFlags.Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
67966
67968
  if (!related) {
67967
67969
  if (reportErrors && (targetArity > 1 || sourceArity > 1)) {
67968
- if (i < startCount || i >= targetArity - endCount || sourceArity - startCount - endCount === 1) {
67969
- reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourceIndex, i);
67970
+ if (targetHasRestElement && sourcePosition >= targetStartCount && sourcePositionFromEnd >= targetEndCount && targetStartCount !== sourceArity - targetEndCount - 1) {
67971
+ reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, targetStartCount, sourceArity - targetEndCount - 1, targetPosition);
67970
67972
  }
67971
67973
  else {
67972
- reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, startCount, sourceArity - endCount - 1, i);
67974
+ reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourcePosition, targetPosition);
67973
67975
  }
67974
67976
  }
67975
67977
  return 0 /* Ternary.False */;
@@ -123021,7 +123023,7 @@ var ts;
123021
123023
  var seenEmittedFiles = (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map()));
123022
123024
  for (var i = state.affectedFilesPendingEmitIndex; i < affectedFilesPendingEmit.length; i++) {
123023
123025
  var affectedFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(affectedFilesPendingEmit[i]);
123024
- if (affectedFile) {
123026
+ if (affectedFile && ts.sourceFileMayBeEmitted(affectedFile, state.program)) {
123025
123027
  var seenKind = seenEmittedFiles.get(affectedFile.resolvedPath);
123026
123028
  var emitKind = ts.Debug.checkDefined(ts.Debug.checkDefined(state.affectedFilesPendingEmitKind).get(affectedFile.resolvedPath));
123027
123029
  if (seenKind === undefined || seenKind < emitKind) {
@@ -123360,6 +123362,9 @@ var ts;
123360
123362
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
123361
123363
  var path = _c[_b];
123362
123364
  if (ts.tryAddToSet(seenFiles, path)) {
123365
+ var file = state.program.getSourceFileByPath(path);
123366
+ if (!ts.sourceFileMayBeEmitted(file, state.program))
123367
+ continue;
123363
123368
  var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
123364
123369
  (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 /* BuilderFileEmit.Full */ ? fileId : [fileId]);
123365
123370
  }
@@ -168186,7 +168191,7 @@ var ts;
168186
168191
  return !!(this.flags & 3145728 /* TypeFlags.UnionOrIntersection */);
168187
168192
  };
168188
168193
  TypeObject.prototype.isLiteral = function () {
168189
- return !!(this.flags & 384 /* TypeFlags.StringOrNumberLiteral */);
168194
+ return !!(this.flags & (128 /* TypeFlags.StringLiteral */ | 256 /* TypeFlags.NumberLiteral */ | 2048 /* TypeFlags.BigIntLiteral */));
168190
168195
  };
168191
168196
  TypeObject.prototype.isStringLiteral = function () {
168192
168197
  return !!(this.flags & 128 /* TypeFlags.StringLiteral */);
@@ -2781,8 +2781,11 @@ declare namespace ts {
2781
2781
  }
2782
2782
  export interface TupleType extends GenericType {
2783
2783
  elementFlags: readonly ElementFlags[];
2784
+ /** Number of required or variadic elements */
2784
2785
  minLength: number;
2786
+ /** Number of initial required or optional elements */
2785
2787
  fixedLength: number;
2788
+ /** True if tuple has any rest or variadic elements */
2786
2789
  hasRestElement: boolean;
2787
2790
  combinedFlags: ElementFlags;
2788
2791
  readonly: boolean;
@@ -108,7 +108,7 @@ var ts;
108
108
  // The following is baselined as a literal template type without intervention
109
109
  /** The version of the TypeScript compiler release */
110
110
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
111
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
111
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221103");
112
112
  /* @internal */
113
113
  var Comparison;
114
114
  (function (Comparison) {
@@ -51406,7 +51406,7 @@ var ts;
51406
51406
  */
51407
51407
  function isSameScopeDescendentOf(initial, parent, stopAt) {
51408
51408
  return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
51409
- || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
51409
+ || (n === stopAt || ts.isFunctionLike(n) && (!ts.getImmediatelyInvokedFunctionExpression(n) || ts.isAsyncFunction(n)) ? "quit" : false); });
51410
51410
  }
51411
51411
  function getAnyImportSyntax(node) {
51412
51412
  switch (node.kind) {
@@ -67921,28 +67921,32 @@ var ts;
67921
67921
  }
67922
67922
  var sourceTypeArguments = getTypeArguments(source);
67923
67923
  var targetTypeArguments = getTypeArguments(target);
67924
- var startCount = Math.min(isTupleType(source) ? getStartElementCount(source.target, 11 /* ElementFlags.NonRest */) : 0, getStartElementCount(target.target, 11 /* ElementFlags.NonRest */));
67925
- var endCount = Math.min(isTupleType(source) ? getEndElementCount(source.target, 11 /* ElementFlags.NonRest */) : 0, targetRestFlag ? getEndElementCount(target.target, 11 /* ElementFlags.NonRest */) : 0);
67924
+ var targetStartCount = getStartElementCount(target.target, 11 /* ElementFlags.NonRest */);
67925
+ var targetEndCount = getEndElementCount(target.target, 11 /* ElementFlags.NonRest */);
67926
+ var targetHasRestElement = target.target.hasRestElement;
67926
67927
  var canExcludeDiscriminants = !!excludedProperties;
67927
- for (var i = 0; i < targetArity; i++) {
67928
- var sourceIndex = i < targetArity - endCount ? i : i + sourceArity - targetArity;
67929
- var sourceFlags = isTupleType(source) && (i < startCount || i >= targetArity - endCount) ? source.target.elementFlags[sourceIndex] : 4 /* ElementFlags.Rest */;
67930
- var targetFlags = target.target.elementFlags[i];
67928
+ for (var sourcePosition = 0; sourcePosition < sourceArity; sourcePosition++) {
67929
+ var sourceFlags = isTupleType(source) ? source.target.elementFlags[sourcePosition] : 4 /* ElementFlags.Rest */;
67930
+ var sourcePositionFromEnd = sourceArity - 1 - sourcePosition;
67931
+ var targetPosition = targetHasRestElement && sourcePosition >= targetStartCount
67932
+ ? targetArity - 1 - Math.min(sourcePositionFromEnd, targetEndCount)
67933
+ : sourcePosition;
67934
+ var targetFlags = target.target.elementFlags[targetPosition];
67931
67935
  if (targetFlags & 8 /* ElementFlags.Variadic */ && !(sourceFlags & 8 /* ElementFlags.Variadic */)) {
67932
67936
  if (reportErrors) {
67933
- reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, i);
67937
+ reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, targetPosition);
67934
67938
  }
67935
67939
  return 0 /* Ternary.False */;
67936
67940
  }
67937
67941
  if (sourceFlags & 8 /* ElementFlags.Variadic */ && !(targetFlags & 12 /* ElementFlags.Variable */)) {
67938
67942
  if (reportErrors) {
67939
- reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourceIndex, i);
67943
+ reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourcePosition, targetPosition);
67940
67944
  }
67941
67945
  return 0 /* Ternary.False */;
67942
67946
  }
67943
67947
  if (targetFlags & 1 /* ElementFlags.Required */ && !(sourceFlags & 1 /* ElementFlags.Required */)) {
67944
67948
  if (reportErrors) {
67945
- reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, i);
67949
+ reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, targetPosition);
67946
67950
  }
67947
67951
  return 0 /* Ternary.False */;
67948
67952
  }
@@ -67951,24 +67955,22 @@ var ts;
67951
67955
  if (sourceFlags & 12 /* ElementFlags.Variable */ || targetFlags & 12 /* ElementFlags.Variable */) {
67952
67956
  canExcludeDiscriminants = false;
67953
67957
  }
67954
- if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + i)))) {
67958
+ if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + sourcePosition)))) {
67955
67959
  continue;
67956
67960
  }
67957
67961
  }
67958
- var sourceType = !isTupleType(source) ? sourceTypeArguments[0] :
67959
- i < startCount || i >= targetArity - endCount ? removeMissingType(sourceTypeArguments[sourceIndex], !!(sourceFlags & targetFlags & 2 /* ElementFlags.Optional */)) :
67960
- getElementTypeOfSliceOfTupleType(source, startCount, endCount) || neverType;
67961
- var targetType = targetTypeArguments[i];
67962
+ var sourceType = removeMissingType(sourceTypeArguments[sourcePosition], !!(sourceFlags & targetFlags & 2 /* ElementFlags.Optional */));
67963
+ var targetType = targetTypeArguments[targetPosition];
67962
67964
  var targetCheckType = sourceFlags & 8 /* ElementFlags.Variadic */ && targetFlags & 4 /* ElementFlags.Rest */ ? createArrayType(targetType) :
67963
67965
  removeMissingType(targetType, !!(targetFlags & 2 /* ElementFlags.Optional */));
67964
67966
  var related = isRelatedTo(sourceType, targetCheckType, 3 /* RecursionFlags.Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
67965
67967
  if (!related) {
67966
67968
  if (reportErrors && (targetArity > 1 || sourceArity > 1)) {
67967
- if (i < startCount || i >= targetArity - endCount || sourceArity - startCount - endCount === 1) {
67968
- reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourceIndex, i);
67969
+ if (targetHasRestElement && sourcePosition >= targetStartCount && sourcePositionFromEnd >= targetEndCount && targetStartCount !== sourceArity - targetEndCount - 1) {
67970
+ reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, targetStartCount, sourceArity - targetEndCount - 1, targetPosition);
67969
67971
  }
67970
67972
  else {
67971
- reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, startCount, sourceArity - endCount - 1, i);
67973
+ reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourcePosition, targetPosition);
67972
67974
  }
67973
67975
  }
67974
67976
  return 0 /* Ternary.False */;
@@ -123020,7 +123022,7 @@ var ts;
123020
123022
  var seenEmittedFiles = (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map()));
123021
123023
  for (var i = state.affectedFilesPendingEmitIndex; i < affectedFilesPendingEmit.length; i++) {
123022
123024
  var affectedFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(affectedFilesPendingEmit[i]);
123023
- if (affectedFile) {
123025
+ if (affectedFile && ts.sourceFileMayBeEmitted(affectedFile, state.program)) {
123024
123026
  var seenKind = seenEmittedFiles.get(affectedFile.resolvedPath);
123025
123027
  var emitKind = ts.Debug.checkDefined(ts.Debug.checkDefined(state.affectedFilesPendingEmitKind).get(affectedFile.resolvedPath));
123026
123028
  if (seenKind === undefined || seenKind < emitKind) {
@@ -123359,6 +123361,9 @@ var ts;
123359
123361
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
123360
123362
  var path = _c[_b];
123361
123363
  if (ts.tryAddToSet(seenFiles, path)) {
123364
+ var file = state.program.getSourceFileByPath(path);
123365
+ if (!ts.sourceFileMayBeEmitted(file, state.program))
123366
+ continue;
123362
123367
  var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
123363
123368
  (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 /* BuilderFileEmit.Full */ ? fileId : [fileId]);
123364
123369
  }
@@ -168604,7 +168609,7 @@ var ts;
168604
168609
  return !!(this.flags & 3145728 /* TypeFlags.UnionOrIntersection */);
168605
168610
  };
168606
168611
  TypeObject.prototype.isLiteral = function () {
168607
- return !!(this.flags & 384 /* TypeFlags.StringOrNumberLiteral */);
168612
+ return !!(this.flags & (128 /* TypeFlags.StringLiteral */ | 256 /* TypeFlags.NumberLiteral */ | 2048 /* TypeFlags.BigIntLiteral */));
168608
168613
  };
168609
168614
  TypeObject.prototype.isStringLiteral = function () {
168610
168615
  return !!(this.flags & 128 /* TypeFlags.StringLiteral */);
@@ -2781,8 +2781,11 @@ declare namespace ts {
2781
2781
  }
2782
2782
  export interface TupleType extends GenericType {
2783
2783
  elementFlags: readonly ElementFlags[];
2784
+ /** Number of required or variadic elements */
2784
2785
  minLength: number;
2786
+ /** Number of initial required or optional elements */
2785
2787
  fixedLength: number;
2788
+ /** True if tuple has any rest or variadic elements */
2786
2789
  hasRestElement: boolean;
2787
2790
  combinedFlags: ElementFlags;
2788
2791
  readonly: boolean;
package/lib/typescript.js CHANGED
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221103");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -51397,7 +51397,7 @@ var ts;
51397
51397
  */
51398
51398
  function isSameScopeDescendentOf(initial, parent, stopAt) {
51399
51399
  return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
51400
- || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
51400
+ || (n === stopAt || ts.isFunctionLike(n) && (!ts.getImmediatelyInvokedFunctionExpression(n) || ts.isAsyncFunction(n)) ? "quit" : false); });
51401
51401
  }
51402
51402
  function getAnyImportSyntax(node) {
51403
51403
  switch (node.kind) {
@@ -67912,28 +67912,32 @@ var ts;
67912
67912
  }
67913
67913
  var sourceTypeArguments = getTypeArguments(source);
67914
67914
  var targetTypeArguments = getTypeArguments(target);
67915
- var startCount = Math.min(isTupleType(source) ? getStartElementCount(source.target, 11 /* ElementFlags.NonRest */) : 0, getStartElementCount(target.target, 11 /* ElementFlags.NonRest */));
67916
- var endCount = Math.min(isTupleType(source) ? getEndElementCount(source.target, 11 /* ElementFlags.NonRest */) : 0, targetRestFlag ? getEndElementCount(target.target, 11 /* ElementFlags.NonRest */) : 0);
67915
+ var targetStartCount = getStartElementCount(target.target, 11 /* ElementFlags.NonRest */);
67916
+ var targetEndCount = getEndElementCount(target.target, 11 /* ElementFlags.NonRest */);
67917
+ var targetHasRestElement = target.target.hasRestElement;
67917
67918
  var canExcludeDiscriminants = !!excludedProperties;
67918
- for (var i = 0; i < targetArity; i++) {
67919
- var sourceIndex = i < targetArity - endCount ? i : i + sourceArity - targetArity;
67920
- var sourceFlags = isTupleType(source) && (i < startCount || i >= targetArity - endCount) ? source.target.elementFlags[sourceIndex] : 4 /* ElementFlags.Rest */;
67921
- var targetFlags = target.target.elementFlags[i];
67919
+ for (var sourcePosition = 0; sourcePosition < sourceArity; sourcePosition++) {
67920
+ var sourceFlags = isTupleType(source) ? source.target.elementFlags[sourcePosition] : 4 /* ElementFlags.Rest */;
67921
+ var sourcePositionFromEnd = sourceArity - 1 - sourcePosition;
67922
+ var targetPosition = targetHasRestElement && sourcePosition >= targetStartCount
67923
+ ? targetArity - 1 - Math.min(sourcePositionFromEnd, targetEndCount)
67924
+ : sourcePosition;
67925
+ var targetFlags = target.target.elementFlags[targetPosition];
67922
67926
  if (targetFlags & 8 /* ElementFlags.Variadic */ && !(sourceFlags & 8 /* ElementFlags.Variadic */)) {
67923
67927
  if (reportErrors) {
67924
- reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, i);
67928
+ reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, targetPosition);
67925
67929
  }
67926
67930
  return 0 /* Ternary.False */;
67927
67931
  }
67928
67932
  if (sourceFlags & 8 /* ElementFlags.Variadic */ && !(targetFlags & 12 /* ElementFlags.Variable */)) {
67929
67933
  if (reportErrors) {
67930
- reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourceIndex, i);
67934
+ reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourcePosition, targetPosition);
67931
67935
  }
67932
67936
  return 0 /* Ternary.False */;
67933
67937
  }
67934
67938
  if (targetFlags & 1 /* ElementFlags.Required */ && !(sourceFlags & 1 /* ElementFlags.Required */)) {
67935
67939
  if (reportErrors) {
67936
- reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, i);
67940
+ reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, targetPosition);
67937
67941
  }
67938
67942
  return 0 /* Ternary.False */;
67939
67943
  }
@@ -67942,24 +67946,22 @@ var ts;
67942
67946
  if (sourceFlags & 12 /* ElementFlags.Variable */ || targetFlags & 12 /* ElementFlags.Variable */) {
67943
67947
  canExcludeDiscriminants = false;
67944
67948
  }
67945
- if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + i)))) {
67949
+ if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + sourcePosition)))) {
67946
67950
  continue;
67947
67951
  }
67948
67952
  }
67949
- var sourceType = !isTupleType(source) ? sourceTypeArguments[0] :
67950
- i < startCount || i >= targetArity - endCount ? removeMissingType(sourceTypeArguments[sourceIndex], !!(sourceFlags & targetFlags & 2 /* ElementFlags.Optional */)) :
67951
- getElementTypeOfSliceOfTupleType(source, startCount, endCount) || neverType;
67952
- var targetType = targetTypeArguments[i];
67953
+ var sourceType = removeMissingType(sourceTypeArguments[sourcePosition], !!(sourceFlags & targetFlags & 2 /* ElementFlags.Optional */));
67954
+ var targetType = targetTypeArguments[targetPosition];
67953
67955
  var targetCheckType = sourceFlags & 8 /* ElementFlags.Variadic */ && targetFlags & 4 /* ElementFlags.Rest */ ? createArrayType(targetType) :
67954
67956
  removeMissingType(targetType, !!(targetFlags & 2 /* ElementFlags.Optional */));
67955
67957
  var related = isRelatedTo(sourceType, targetCheckType, 3 /* RecursionFlags.Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
67956
67958
  if (!related) {
67957
67959
  if (reportErrors && (targetArity > 1 || sourceArity > 1)) {
67958
- if (i < startCount || i >= targetArity - endCount || sourceArity - startCount - endCount === 1) {
67959
- reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourceIndex, i);
67960
+ if (targetHasRestElement && sourcePosition >= targetStartCount && sourcePositionFromEnd >= targetEndCount && targetStartCount !== sourceArity - targetEndCount - 1) {
67961
+ reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, targetStartCount, sourceArity - targetEndCount - 1, targetPosition);
67960
67962
  }
67961
67963
  else {
67962
- reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, startCount, sourceArity - endCount - 1, i);
67964
+ reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourcePosition, targetPosition);
67963
67965
  }
67964
67966
  }
67965
67967
  return 0 /* Ternary.False */;
@@ -123011,7 +123013,7 @@ var ts;
123011
123013
  var seenEmittedFiles = (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map()));
123012
123014
  for (var i = state.affectedFilesPendingEmitIndex; i < affectedFilesPendingEmit.length; i++) {
123013
123015
  var affectedFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(affectedFilesPendingEmit[i]);
123014
- if (affectedFile) {
123016
+ if (affectedFile && ts.sourceFileMayBeEmitted(affectedFile, state.program)) {
123015
123017
  var seenKind = seenEmittedFiles.get(affectedFile.resolvedPath);
123016
123018
  var emitKind = ts.Debug.checkDefined(ts.Debug.checkDefined(state.affectedFilesPendingEmitKind).get(affectedFile.resolvedPath));
123017
123019
  if (seenKind === undefined || seenKind < emitKind) {
@@ -123350,6 +123352,9 @@ var ts;
123350
123352
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
123351
123353
  var path = _c[_b];
123352
123354
  if (ts.tryAddToSet(seenFiles, path)) {
123355
+ var file = state.program.getSourceFileByPath(path);
123356
+ if (!ts.sourceFileMayBeEmitted(file, state.program))
123357
+ continue;
123353
123358
  var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
123354
123359
  (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 /* BuilderFileEmit.Full */ ? fileId : [fileId]);
123355
123360
  }
@@ -168595,7 +168600,7 @@ var ts;
168595
168600
  return !!(this.flags & 3145728 /* TypeFlags.UnionOrIntersection */);
168596
168601
  };
168597
168602
  TypeObject.prototype.isLiteral = function () {
168598
- return !!(this.flags & 384 /* TypeFlags.StringOrNumberLiteral */);
168603
+ return !!(this.flags & (128 /* TypeFlags.StringLiteral */ | 256 /* TypeFlags.NumberLiteral */ | 2048 /* TypeFlags.BigIntLiteral */));
168599
168604
  };
168600
168605
  TypeObject.prototype.isStringLiteral = function () {
168601
168606
  return !!(this.flags & 128 /* TypeFlags.StringLiteral */);
@@ -2781,8 +2781,11 @@ declare namespace ts {
2781
2781
  }
2782
2782
  export interface TupleType extends GenericType {
2783
2783
  elementFlags: readonly ElementFlags[];
2784
+ /** Number of required or variadic elements */
2784
2785
  minLength: number;
2786
+ /** Number of initial required or optional elements */
2785
2787
  fixedLength: number;
2788
+ /** True if tuple has any rest or variadic elements */
2786
2789
  hasRestElement: boolean;
2787
2790
  combinedFlags: ElementFlags;
2788
2791
  readonly: boolean;
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221103");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -51397,7 +51397,7 @@ var ts;
51397
51397
  */
51398
51398
  function isSameScopeDescendentOf(initial, parent, stopAt) {
51399
51399
  return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
51400
- || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
51400
+ || (n === stopAt || ts.isFunctionLike(n) && (!ts.getImmediatelyInvokedFunctionExpression(n) || ts.isAsyncFunction(n)) ? "quit" : false); });
51401
51401
  }
51402
51402
  function getAnyImportSyntax(node) {
51403
51403
  switch (node.kind) {
@@ -67912,28 +67912,32 @@ var ts;
67912
67912
  }
67913
67913
  var sourceTypeArguments = getTypeArguments(source);
67914
67914
  var targetTypeArguments = getTypeArguments(target);
67915
- var startCount = Math.min(isTupleType(source) ? getStartElementCount(source.target, 11 /* ElementFlags.NonRest */) : 0, getStartElementCount(target.target, 11 /* ElementFlags.NonRest */));
67916
- var endCount = Math.min(isTupleType(source) ? getEndElementCount(source.target, 11 /* ElementFlags.NonRest */) : 0, targetRestFlag ? getEndElementCount(target.target, 11 /* ElementFlags.NonRest */) : 0);
67915
+ var targetStartCount = getStartElementCount(target.target, 11 /* ElementFlags.NonRest */);
67916
+ var targetEndCount = getEndElementCount(target.target, 11 /* ElementFlags.NonRest */);
67917
+ var targetHasRestElement = target.target.hasRestElement;
67917
67918
  var canExcludeDiscriminants = !!excludedProperties;
67918
- for (var i = 0; i < targetArity; i++) {
67919
- var sourceIndex = i < targetArity - endCount ? i : i + sourceArity - targetArity;
67920
- var sourceFlags = isTupleType(source) && (i < startCount || i >= targetArity - endCount) ? source.target.elementFlags[sourceIndex] : 4 /* ElementFlags.Rest */;
67921
- var targetFlags = target.target.elementFlags[i];
67919
+ for (var sourcePosition = 0; sourcePosition < sourceArity; sourcePosition++) {
67920
+ var sourceFlags = isTupleType(source) ? source.target.elementFlags[sourcePosition] : 4 /* ElementFlags.Rest */;
67921
+ var sourcePositionFromEnd = sourceArity - 1 - sourcePosition;
67922
+ var targetPosition = targetHasRestElement && sourcePosition >= targetStartCount
67923
+ ? targetArity - 1 - Math.min(sourcePositionFromEnd, targetEndCount)
67924
+ : sourcePosition;
67925
+ var targetFlags = target.target.elementFlags[targetPosition];
67922
67926
  if (targetFlags & 8 /* ElementFlags.Variadic */ && !(sourceFlags & 8 /* ElementFlags.Variadic */)) {
67923
67927
  if (reportErrors) {
67924
- reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, i);
67928
+ reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, targetPosition);
67925
67929
  }
67926
67930
  return 0 /* Ternary.False */;
67927
67931
  }
67928
67932
  if (sourceFlags & 8 /* ElementFlags.Variadic */ && !(targetFlags & 12 /* ElementFlags.Variable */)) {
67929
67933
  if (reportErrors) {
67930
- reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourceIndex, i);
67934
+ reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourcePosition, targetPosition);
67931
67935
  }
67932
67936
  return 0 /* Ternary.False */;
67933
67937
  }
67934
67938
  if (targetFlags & 1 /* ElementFlags.Required */ && !(sourceFlags & 1 /* ElementFlags.Required */)) {
67935
67939
  if (reportErrors) {
67936
- reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, i);
67940
+ reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, targetPosition);
67937
67941
  }
67938
67942
  return 0 /* Ternary.False */;
67939
67943
  }
@@ -67942,24 +67946,22 @@ var ts;
67942
67946
  if (sourceFlags & 12 /* ElementFlags.Variable */ || targetFlags & 12 /* ElementFlags.Variable */) {
67943
67947
  canExcludeDiscriminants = false;
67944
67948
  }
67945
- if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + i)))) {
67949
+ if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + sourcePosition)))) {
67946
67950
  continue;
67947
67951
  }
67948
67952
  }
67949
- var sourceType = !isTupleType(source) ? sourceTypeArguments[0] :
67950
- i < startCount || i >= targetArity - endCount ? removeMissingType(sourceTypeArguments[sourceIndex], !!(sourceFlags & targetFlags & 2 /* ElementFlags.Optional */)) :
67951
- getElementTypeOfSliceOfTupleType(source, startCount, endCount) || neverType;
67952
- var targetType = targetTypeArguments[i];
67953
+ var sourceType = removeMissingType(sourceTypeArguments[sourcePosition], !!(sourceFlags & targetFlags & 2 /* ElementFlags.Optional */));
67954
+ var targetType = targetTypeArguments[targetPosition];
67953
67955
  var targetCheckType = sourceFlags & 8 /* ElementFlags.Variadic */ && targetFlags & 4 /* ElementFlags.Rest */ ? createArrayType(targetType) :
67954
67956
  removeMissingType(targetType, !!(targetFlags & 2 /* ElementFlags.Optional */));
67955
67957
  var related = isRelatedTo(sourceType, targetCheckType, 3 /* RecursionFlags.Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
67956
67958
  if (!related) {
67957
67959
  if (reportErrors && (targetArity > 1 || sourceArity > 1)) {
67958
- if (i < startCount || i >= targetArity - endCount || sourceArity - startCount - endCount === 1) {
67959
- reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourceIndex, i);
67960
+ if (targetHasRestElement && sourcePosition >= targetStartCount && sourcePositionFromEnd >= targetEndCount && targetStartCount !== sourceArity - targetEndCount - 1) {
67961
+ reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, targetStartCount, sourceArity - targetEndCount - 1, targetPosition);
67960
67962
  }
67961
67963
  else {
67962
- reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, startCount, sourceArity - endCount - 1, i);
67964
+ reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourcePosition, targetPosition);
67963
67965
  }
67964
67966
  }
67965
67967
  return 0 /* Ternary.False */;
@@ -123011,7 +123013,7 @@ var ts;
123011
123013
  var seenEmittedFiles = (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map()));
123012
123014
  for (var i = state.affectedFilesPendingEmitIndex; i < affectedFilesPendingEmit.length; i++) {
123013
123015
  var affectedFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(affectedFilesPendingEmit[i]);
123014
- if (affectedFile) {
123016
+ if (affectedFile && ts.sourceFileMayBeEmitted(affectedFile, state.program)) {
123015
123017
  var seenKind = seenEmittedFiles.get(affectedFile.resolvedPath);
123016
123018
  var emitKind = ts.Debug.checkDefined(ts.Debug.checkDefined(state.affectedFilesPendingEmitKind).get(affectedFile.resolvedPath));
123017
123019
  if (seenKind === undefined || seenKind < emitKind) {
@@ -123350,6 +123352,9 @@ var ts;
123350
123352
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
123351
123353
  var path = _c[_b];
123352
123354
  if (ts.tryAddToSet(seenFiles, path)) {
123355
+ var file = state.program.getSourceFileByPath(path);
123356
+ if (!ts.sourceFileMayBeEmitted(file, state.program))
123357
+ continue;
123353
123358
  var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
123354
123359
  (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 /* BuilderFileEmit.Full */ ? fileId : [fileId]);
123355
123360
  }
@@ -168595,7 +168600,7 @@ var ts;
168595
168600
  return !!(this.flags & 3145728 /* TypeFlags.UnionOrIntersection */);
168596
168601
  };
168597
168602
  TypeObject.prototype.isLiteral = function () {
168598
- return !!(this.flags & 384 /* TypeFlags.StringOrNumberLiteral */);
168603
+ return !!(this.flags & (128 /* TypeFlags.StringLiteral */ | 256 /* TypeFlags.NumberLiteral */ | 2048 /* TypeFlags.BigIntLiteral */));
168599
168604
  };
168600
168605
  TypeObject.prototype.isStringLiteral = function () {
168601
168606
  return !!(this.flags & 128 /* TypeFlags.StringLiteral */);
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
92
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221103");
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -51387,7 +51387,7 @@ var ts;
51387
51387
  */
51388
51388
  function isSameScopeDescendentOf(initial, parent, stopAt) {
51389
51389
  return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
51390
- || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
51390
+ || (n === stopAt || ts.isFunctionLike(n) && (!ts.getImmediatelyInvokedFunctionExpression(n) || ts.isAsyncFunction(n)) ? "quit" : false); });
51391
51391
  }
51392
51392
  function getAnyImportSyntax(node) {
51393
51393
  switch (node.kind) {
@@ -67902,28 +67902,32 @@ var ts;
67902
67902
  }
67903
67903
  var sourceTypeArguments = getTypeArguments(source);
67904
67904
  var targetTypeArguments = getTypeArguments(target);
67905
- var startCount = Math.min(isTupleType(source) ? getStartElementCount(source.target, 11 /* ElementFlags.NonRest */) : 0, getStartElementCount(target.target, 11 /* ElementFlags.NonRest */));
67906
- var endCount = Math.min(isTupleType(source) ? getEndElementCount(source.target, 11 /* ElementFlags.NonRest */) : 0, targetRestFlag ? getEndElementCount(target.target, 11 /* ElementFlags.NonRest */) : 0);
67905
+ var targetStartCount = getStartElementCount(target.target, 11 /* ElementFlags.NonRest */);
67906
+ var targetEndCount = getEndElementCount(target.target, 11 /* ElementFlags.NonRest */);
67907
+ var targetHasRestElement = target.target.hasRestElement;
67907
67908
  var canExcludeDiscriminants = !!excludedProperties;
67908
- for (var i = 0; i < targetArity; i++) {
67909
- var sourceIndex = i < targetArity - endCount ? i : i + sourceArity - targetArity;
67910
- var sourceFlags = isTupleType(source) && (i < startCount || i >= targetArity - endCount) ? source.target.elementFlags[sourceIndex] : 4 /* ElementFlags.Rest */;
67911
- var targetFlags = target.target.elementFlags[i];
67909
+ for (var sourcePosition = 0; sourcePosition < sourceArity; sourcePosition++) {
67910
+ var sourceFlags = isTupleType(source) ? source.target.elementFlags[sourcePosition] : 4 /* ElementFlags.Rest */;
67911
+ var sourcePositionFromEnd = sourceArity - 1 - sourcePosition;
67912
+ var targetPosition = targetHasRestElement && sourcePosition >= targetStartCount
67913
+ ? targetArity - 1 - Math.min(sourcePositionFromEnd, targetEndCount)
67914
+ : sourcePosition;
67915
+ var targetFlags = target.target.elementFlags[targetPosition];
67912
67916
  if (targetFlags & 8 /* ElementFlags.Variadic */ && !(sourceFlags & 8 /* ElementFlags.Variadic */)) {
67913
67917
  if (reportErrors) {
67914
- reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, i);
67918
+ reportError(ts.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, targetPosition);
67915
67919
  }
67916
67920
  return 0 /* Ternary.False */;
67917
67921
  }
67918
67922
  if (sourceFlags & 8 /* ElementFlags.Variadic */ && !(targetFlags & 12 /* ElementFlags.Variable */)) {
67919
67923
  if (reportErrors) {
67920
- reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourceIndex, i);
67924
+ reportError(ts.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourcePosition, targetPosition);
67921
67925
  }
67922
67926
  return 0 /* Ternary.False */;
67923
67927
  }
67924
67928
  if (targetFlags & 1 /* ElementFlags.Required */ && !(sourceFlags & 1 /* ElementFlags.Required */)) {
67925
67929
  if (reportErrors) {
67926
- reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, i);
67930
+ reportError(ts.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, targetPosition);
67927
67931
  }
67928
67932
  return 0 /* Ternary.False */;
67929
67933
  }
@@ -67932,24 +67936,22 @@ var ts;
67932
67936
  if (sourceFlags & 12 /* ElementFlags.Variable */ || targetFlags & 12 /* ElementFlags.Variable */) {
67933
67937
  canExcludeDiscriminants = false;
67934
67938
  }
67935
- if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + i)))) {
67939
+ if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has(("" + sourcePosition)))) {
67936
67940
  continue;
67937
67941
  }
67938
67942
  }
67939
- var sourceType = !isTupleType(source) ? sourceTypeArguments[0] :
67940
- i < startCount || i >= targetArity - endCount ? removeMissingType(sourceTypeArguments[sourceIndex], !!(sourceFlags & targetFlags & 2 /* ElementFlags.Optional */)) :
67941
- getElementTypeOfSliceOfTupleType(source, startCount, endCount) || neverType;
67942
- var targetType = targetTypeArguments[i];
67943
+ var sourceType = removeMissingType(sourceTypeArguments[sourcePosition], !!(sourceFlags & targetFlags & 2 /* ElementFlags.Optional */));
67944
+ var targetType = targetTypeArguments[targetPosition];
67943
67945
  var targetCheckType = sourceFlags & 8 /* ElementFlags.Variadic */ && targetFlags & 4 /* ElementFlags.Rest */ ? createArrayType(targetType) :
67944
67946
  removeMissingType(targetType, !!(targetFlags & 2 /* ElementFlags.Optional */));
67945
67947
  var related = isRelatedTo(sourceType, targetCheckType, 3 /* RecursionFlags.Both */, reportErrors, /*headMessage*/ undefined, intersectionState);
67946
67948
  if (!related) {
67947
67949
  if (reportErrors && (targetArity > 1 || sourceArity > 1)) {
67948
- if (i < startCount || i >= targetArity - endCount || sourceArity - startCount - endCount === 1) {
67949
- reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourceIndex, i);
67950
+ if (targetHasRestElement && sourcePosition >= targetStartCount && sourcePositionFromEnd >= targetEndCount && targetStartCount !== sourceArity - targetEndCount - 1) {
67951
+ reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, targetStartCount, sourceArity - targetEndCount - 1, targetPosition);
67950
67952
  }
67951
67953
  else {
67952
- reportIncompatibleError(ts.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, startCount, sourceArity - endCount - 1, i);
67954
+ reportIncompatibleError(ts.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourcePosition, targetPosition);
67953
67955
  }
67954
67956
  }
67955
67957
  return 0 /* Ternary.False */;
@@ -123001,7 +123003,7 @@ var ts;
123001
123003
  var seenEmittedFiles = (state.seenEmittedFiles || (state.seenEmittedFiles = new ts.Map()));
123002
123004
  for (var i = state.affectedFilesPendingEmitIndex; i < affectedFilesPendingEmit.length; i++) {
123003
123005
  var affectedFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(affectedFilesPendingEmit[i]);
123004
- if (affectedFile) {
123006
+ if (affectedFile && ts.sourceFileMayBeEmitted(affectedFile, state.program)) {
123005
123007
  var seenKind = seenEmittedFiles.get(affectedFile.resolvedPath);
123006
123008
  var emitKind = ts.Debug.checkDefined(ts.Debug.checkDefined(state.affectedFilesPendingEmitKind).get(affectedFile.resolvedPath));
123007
123009
  if (seenKind === undefined || seenKind < emitKind) {
@@ -123340,6 +123342,9 @@ var ts;
123340
123342
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
123341
123343
  var path = _c[_b];
123342
123344
  if (ts.tryAddToSet(seenFiles, path)) {
123345
+ var file = state.program.getSourceFileByPath(path);
123346
+ if (!ts.sourceFileMayBeEmitted(file, state.program))
123347
+ continue;
123343
123348
  var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
123344
123349
  (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 /* BuilderFileEmit.Full */ ? fileId : [fileId]);
123345
123350
  }
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.0.0-dev.20221101",
5
+ "version": "5.0.0-dev.20221103",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [