typescript 5.6.0-dev.20240617 → 5.6.0-dev.20240619

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,16 +18,16 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.6";
21
- var version = `${versionMajorMinor}.0-dev.20240617`;
21
+ var version = `${versionMajorMinor}.0-dev.20240619`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
25
25
  var emptyMap = /* @__PURE__ */ new Map();
26
26
  function length(array) {
27
- return array ? array.length : 0;
27
+ return array !== void 0 ? array.length : 0;
28
28
  }
29
29
  function forEach(array, callback) {
30
- if (array) {
30
+ if (array !== void 0) {
31
31
  for (let i = 0; i < array.length; i++) {
32
32
  const result = callback(array[i], i);
33
33
  if (result) {
@@ -78,7 +78,7 @@ function zipWith(arrayA, arrayB, callback) {
78
78
  return result;
79
79
  }
80
80
  function every(array, callback) {
81
- if (array) {
81
+ if (array !== void 0) {
82
82
  for (let i = 0; i < array.length; i++) {
83
83
  if (!callback(array[i], i)) {
84
84
  return false;
@@ -126,20 +126,17 @@ function findLastIndex(array, predicate, startIndex) {
126
126
  return -1;
127
127
  }
128
128
  function contains(array, value, equalityComparer = equateValues) {
129
- if (array) {
130
- for (const v of array) {
131
- if (equalityComparer(v, value)) {
129
+ if (array !== void 0) {
130
+ for (let i = 0; i < array.length; i++) {
131
+ if (equalityComparer(array[i], value)) {
132
132
  return true;
133
133
  }
134
134
  }
135
135
  }
136
136
  return false;
137
137
  }
138
- function arraysEqual(a, b, equalityComparer = equateValues) {
139
- return a.length === b.length && a.every((x, i) => equalityComparer(x, b[i]));
140
- }
141
138
  function indexOfAnyCharCode(text, charCodes, start) {
142
- for (let i = start || 0; i < text.length; i++) {
139
+ for (let i = start ?? 0; i < text.length; i++) {
143
140
  if (contains(charCodes, text.charCodeAt(i))) {
144
141
  return i;
145
142
  }
@@ -148,7 +145,7 @@ function indexOfAnyCharCode(text, charCodes, start) {
148
145
  }
149
146
  function countWhere(array, predicate) {
150
147
  let count = 0;
151
- if (array) {
148
+ if (array !== void 0) {
152
149
  for (let i = 0; i < array.length; i++) {
153
150
  const v = array[i];
154
151
  if (predicate(v, i)) {
@@ -159,7 +156,7 @@ function countWhere(array, predicate) {
159
156
  return count;
160
157
  }
161
158
  function filter(array, f) {
162
- if (array) {
159
+ if (array !== void 0) {
163
160
  const len = array.length;
164
161
  let i = 0;
165
162
  while (i < len && f(array[i])) i++;
@@ -193,7 +190,7 @@ function clear(array) {
193
190
  }
194
191
  function map(array, f) {
195
192
  let result;
196
- if (array) {
193
+ if (array !== void 0) {
197
194
  result = [];
198
195
  for (let i = 0; i < array.length; i++) {
199
196
  result.push(f(array[i], i));
@@ -207,7 +204,7 @@ function* mapIterator(iter, mapFn) {
207
204
  }
208
205
  }
209
206
  function sameMap(array, f) {
210
- if (array) {
207
+ if (array !== void 0) {
211
208
  for (let i = 0; i < array.length; i++) {
212
209
  const item = array[i];
213
210
  const mapped = f(item, i);
@@ -225,7 +222,8 @@ function sameMap(array, f) {
225
222
  }
226
223
  function flatten(array) {
227
224
  const result = [];
228
- for (const v of array) {
225
+ for (let i = 0; i < array.length; i++) {
226
+ const v = array[i];
229
227
  if (v) {
230
228
  if (isArray(v)) {
231
229
  addRange(result, v);
@@ -238,7 +236,7 @@ function flatten(array) {
238
236
  }
239
237
  function flatMap(array, mapfn) {
240
238
  let result;
241
- if (array) {
239
+ if (array !== void 0) {
242
240
  for (let i = 0; i < array.length; i++) {
243
241
  const v = mapfn(array[i], i);
244
242
  if (v) {
@@ -250,11 +248,11 @@ function flatMap(array, mapfn) {
250
248
  }
251
249
  }
252
250
  }
253
- return result || emptyArray;
251
+ return result ?? emptyArray;
254
252
  }
255
253
  function flatMapToMutable(array, mapfn) {
256
254
  const result = [];
257
- if (array) {
255
+ if (array !== void 0) {
258
256
  for (let i = 0; i < array.length; i++) {
259
257
  const v = mapfn(array[i], i);
260
258
  if (v) {
@@ -270,7 +268,7 @@ function flatMapToMutable(array, mapfn) {
270
268
  }
271
269
  function sameFlatMap(array, mapfn) {
272
270
  let result;
273
- if (array) {
271
+ if (array !== void 0) {
274
272
  for (let i = 0; i < array.length; i++) {
275
273
  const item = array[i];
276
274
  const mapped = mapfn(item, i);
@@ -286,11 +284,11 @@ function sameFlatMap(array, mapfn) {
286
284
  }
287
285
  }
288
286
  }
289
- return result || array;
287
+ return result ?? array;
290
288
  }
291
289
  function mapDefined(array, mapFn) {
292
290
  const result = [];
293
- if (array) {
291
+ if (array !== void 0) {
294
292
  for (let i = 0; i < array.length; i++) {
295
293
  const mapped = mapFn(array[i], i);
296
294
  if (mapped !== void 0) {
@@ -325,7 +323,7 @@ function tryAddToSet(set, value) {
325
323
  }
326
324
  function spanMap(array, keyfn, mapfn) {
327
325
  let result;
328
- if (array) {
326
+ if (array !== void 0) {
329
327
  result = [];
330
328
  const len = array.length;
331
329
  let previousKey;
@@ -357,10 +355,10 @@ function spanMap(array, keyfn, mapfn) {
357
355
  return result;
358
356
  }
359
357
  function some(array, predicate) {
360
- if (array) {
361
- if (predicate) {
362
- for (const v of array) {
363
- if (predicate(v)) {
358
+ if (array !== void 0) {
359
+ if (predicate !== void 0) {
360
+ for (let i = 0; i < array.length; i++) {
361
+ if (predicate(array[i])) {
364
362
  return true;
365
363
  }
366
364
  }
@@ -385,8 +383,8 @@ function getRangesWhere(arr, pred, cb) {
385
383
  if (start !== void 0) cb(start, arr.length);
386
384
  }
387
385
  function concatenate(array1, array2) {
388
- if (!some(array2)) return array1;
389
- if (!some(array1)) return array2;
386
+ if (array2 === void 0 || array2.length === 0) return array1;
387
+ if (array1 === void 0 || array1.length === 0) return array2;
390
388
  return [...array1, ...array2];
391
389
  }
392
390
  function selectIndex(_, i) {
@@ -413,8 +411,8 @@ function deduplicateRelational(array, equalityComparer, comparer) {
413
411
  }
414
412
  function deduplicateEquality(array, equalityComparer) {
415
413
  const result = [];
416
- for (const item of array) {
417
- pushIfUnique(result, item, equalityComparer);
414
+ for (let i = 0; i < array.length; i++) {
415
+ pushIfUnique(result, array[i], equalityComparer);
418
416
  }
419
417
  return result;
420
418
  }
@@ -465,10 +463,10 @@ function insertSorted(array, insert, compare, equalityComparer, allowDuplicates)
465
463
  return false;
466
464
  }
467
465
  function sortAndDeduplicate(array, comparer, equalityComparer) {
468
- return deduplicateSorted(sort(array, comparer), equalityComparer || comparer || compareStringsCaseSensitive);
466
+ return deduplicateSorted(sort(array, comparer), equalityComparer ?? comparer ?? compareStringsCaseSensitive);
469
467
  }
470
468
  function arrayIsEqualTo(array1, array2, equalityComparer = equateValues) {
471
- if (!array1 || !array2) {
469
+ if (array1 === void 0 || array2 === void 0) {
472
470
  return array1 === array2;
473
471
  }
474
472
  if (array1.length !== array2.length) {
@@ -483,20 +481,18 @@ function arrayIsEqualTo(array1, array2, equalityComparer = equateValues) {
483
481
  }
484
482
  function compact(array) {
485
483
  let result;
486
- if (array) {
484
+ if (array !== void 0) {
487
485
  for (let i = 0; i < array.length; i++) {
488
486
  const v = array[i];
489
- if (result || !v) {
490
- if (!result) {
491
- result = array.slice(0, i);
492
- }
487
+ if (result ?? !v) {
488
+ result ?? (result = array.slice(0, i));
493
489
  if (v) {
494
490
  result.push(v);
495
491
  }
496
492
  }
497
493
  }
498
494
  }
499
- return result || array;
495
+ return result ?? array;
500
496
  }
501
497
  function relativeComplement(arrayA, arrayB, comparer) {
502
498
  if (!arrayB || !arrayA || arrayB.length === 0 || arrayA.length === 0) return arrayB;
@@ -554,7 +550,7 @@ function pushIfUnique(array, toAdd, equalityComparer) {
554
550
  }
555
551
  }
556
552
  function appendIfUnique(array, toAdd, equalityComparer) {
557
- if (array) {
553
+ if (array !== void 0) {
558
554
  pushIfUnique(array, toAdd, equalityComparer);
559
555
  return array;
560
556
  } else {
@@ -582,7 +578,7 @@ function rangeEquals(array1, array2, pos, end) {
582
578
  return true;
583
579
  }
584
580
  var elementAt = !!Array.prototype.at ? (array, offset) => array == null ? void 0 : array.at(offset) : (array, offset) => {
585
- if (array) {
581
+ if (array !== void 0) {
586
582
  offset = toOffset(array, offset);
587
583
  if (offset < array.length) {
588
584
  return array[offset];
@@ -594,7 +590,7 @@ function firstOrUndefined(array) {
594
590
  return array === void 0 || array.length === 0 ? void 0 : array[0];
595
591
  }
596
592
  function firstOrUndefinedIterator(iter) {
597
- if (iter) {
593
+ if (iter !== void 0) {
598
594
  for (const value of iter) {
599
595
  return value;
600
596
  }
@@ -619,10 +615,10 @@ function last(array) {
619
615
  return array[array.length - 1];
620
616
  }
621
617
  function singleOrUndefined(array) {
622
- return array && array.length === 1 ? array[0] : void 0;
618
+ return array !== void 0 && array.length === 1 ? array[0] : void 0;
623
619
  }
624
620
  function singleOrMany(array) {
625
- return array && array.length === 1 ? array[0] : array;
621
+ return array !== void 0 && array.length === 1 ? array[0] : array;
626
622
  }
627
623
  function replaceElement(array, index, value) {
628
624
  const result = array.slice(0);
@@ -636,7 +632,7 @@ function binarySearchKey(array, key, keySelector, keyComparer, offset) {
636
632
  if (!some(array)) {
637
633
  return -1;
638
634
  }
639
- let low = offset || 0;
635
+ let low = offset ?? 0;
640
636
  let high = array.length - 1;
641
637
  while (low <= high) {
642
638
  const middle = low + (high - low >> 1);
@@ -741,7 +737,8 @@ function equalOwnProperties(left, right, equalityComparer = equateValues) {
741
737
  }
742
738
  function arrayToMap(array, makeKey, makeValue = identity) {
743
739
  const result = /* @__PURE__ */ new Map();
744
- for (const value of array) {
740
+ for (let i = 0; i < array.length; i++) {
741
+ const value = array[i];
745
742
  const key = makeKey(value);
746
743
  if (key !== void 0) result.set(key, makeValue(value));
747
744
  }
@@ -749,7 +746,8 @@ function arrayToMap(array, makeKey, makeValue = identity) {
749
746
  }
750
747
  function arrayToMultiMap(values, makeKey, makeValue = identity) {
751
748
  const result = createMultiMap();
752
- for (const value of values) {
749
+ for (let i = 0; i < values.length; i++) {
750
+ const value = values[i];
753
751
  result.add(makeKey(value), makeValue(value));
754
752
  }
755
753
  return result;
@@ -759,8 +757,9 @@ function group(values, getGroupId, resultSelector = identity) {
759
757
  }
760
758
  function groupBy(values, keySelector) {
761
759
  const result = {};
762
- if (values) {
763
- for (const value of values) {
760
+ if (values !== void 0) {
761
+ for (let i = 0; i < values.length; i++) {
762
+ const value = values[i];
764
763
  const key = `${keySelector(value)}`;
765
764
  const array = result[key] ?? (result[key] = []);
766
765
  array.push(value);
@@ -790,7 +789,7 @@ function copyProperties(first2, second) {
790
789
  }
791
790
  }
792
791
  function maybeBind(obj, fn) {
793
- return fn ? fn.bind(obj) : void 0;
792
+ return fn == null ? void 0 : fn.bind(obj);
794
793
  }
795
794
  function createMultiMap() {
796
795
  const map2 = /* @__PURE__ */ new Map();
@@ -800,7 +799,7 @@ function createMultiMap() {
800
799
  }
801
800
  function multiMapAdd(key, value) {
802
801
  let values = this.get(key);
803
- if (values) {
802
+ if (values !== void 0) {
804
803
  values.push(value);
805
804
  } else {
806
805
  this.set(key, values = [value]);
@@ -809,7 +808,7 @@ function multiMapAdd(key, value) {
809
808
  }
810
809
  function multiMapRemove(key, value) {
811
810
  const values = this.get(key);
812
- if (values) {
811
+ if (values !== void 0) {
813
812
  unorderedRemoveItem(values, value);
814
813
  if (!values.length) {
815
814
  this.delete(key);
@@ -817,7 +816,7 @@ function multiMapRemove(key, value) {
817
816
  }
818
817
  }
819
818
  function createQueue(items) {
820
- const elements = (items == null ? void 0 : items.slice()) || [];
819
+ const elements = (items == null ? void 0 : items.slice()) ?? [];
821
820
  let headIndex = 0;
822
821
  function isEmpty() {
823
822
  return headIndex === elements.length;
@@ -931,6 +930,12 @@ function compareComparableValues(a, b) {
931
930
  function compareValues(a, b) {
932
931
  return compareComparableValues(a, b);
933
932
  }
933
+ function maxBy(arr, init, mapper) {
934
+ for (let i = 0; i < arr.length; i++) {
935
+ init = Math.max(init, mapper(arr[i]));
936
+ }
937
+ return init;
938
+ }
934
939
  function min(items, compare) {
935
940
  return reduceLeft(items, (x, y) => compare(x, y) === -1 /* LessThan */ ? x : y);
936
941
  }
@@ -1076,7 +1081,8 @@ function matchedText(pattern, candidate) {
1076
1081
  function findBestPatternMatch(values, getPattern, candidate) {
1077
1082
  let matchedValue;
1078
1083
  let longestMatchPrefixLength = -1;
1079
- for (const v of values) {
1084
+ for (let i = 0; i < values.length; i++) {
1085
+ const v = values[i];
1080
1086
  const pattern = getPattern(v);
1081
1087
  if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) {
1082
1088
  longestMatchPrefixLength = pattern.prefix.length;
@@ -1118,7 +1124,7 @@ function singleElementArray(t) {
1118
1124
  return t === void 0 ? void 0 : [t];
1119
1125
  }
1120
1126
  function enumerateInsertsAndDeletes(newItems, oldItems, comparer, inserted, deleted, unchanged) {
1121
- unchanged = unchanged || noop;
1127
+ unchanged ?? (unchanged = noop);
1122
1128
  let newIndex = 0;
1123
1129
  let oldIndex = 0;
1124
1130
  const newLen = newItems.length;
@@ -1180,7 +1186,7 @@ function cartesianProductWorker(arrays, result, outer, index) {
1180
1186
  }
1181
1187
  }
1182
1188
  function takeWhile(array, predicate) {
1183
- if (array) {
1189
+ if (array !== void 0) {
1184
1190
  const len = array.length;
1185
1191
  let index = 0;
1186
1192
  while (index < len && predicate(array[index])) {
@@ -1190,7 +1196,7 @@ function takeWhile(array, predicate) {
1190
1196
  }
1191
1197
  }
1192
1198
  function skipWhile(array, predicate) {
1193
- if (array) {
1199
+ if (array !== void 0) {
1194
1200
  const len = array.length;
1195
1201
  let index = 0;
1196
1202
  while (index < len && predicate(array[index])) {
@@ -2107,7 +2113,7 @@ m2: ${this.mapper2.__debugToString().split("\n").join("\n ")}`;
2107
2113
  }
2108
2114
  function renderGraph() {
2109
2115
  const columnCount = columnWidths.length;
2110
- const laneCount = nodes.reduce((x, n) => Math.max(x, n.lane), 0) + 1;
2116
+ const laneCount = maxBy(nodes, 0, (n) => n.lane) + 1;
2111
2117
  const lanes = fill(Array(laneCount), "");
2112
2118
  const grid = columnWidths.map(() => Array(laneCount));
2113
2119
  const connectors = columnWidths.map(() => fill(Array(laneCount), 0));
@@ -8115,7 +8121,7 @@ function computePositionOfLineAndCharacter(lineStarts, line, character, debugTex
8115
8121
  if (allowEdits) {
8116
8122
  line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
8117
8123
  } else {
8118
- Debug.fail(`Bad line number. Line: ${line}, lineStarts.length: ${lineStarts.length} , line map is correct? ${debugText !== void 0 ? arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"}`);
8124
+ Debug.fail(`Bad line number. Line: ${line}, lineStarts.length: ${lineStarts.length} , line map is correct? ${debugText !== void 0 ? arrayIsEqualTo(lineStarts, computeLineStarts(debugText)) : "unknown"}`);
8119
8125
  }
8120
8126
  }
8121
8127
  const res = lineStarts[line] + character;
@@ -12445,6 +12451,9 @@ function createSymbolTable(symbols) {
12445
12451
  function isTransientSymbol(symbol) {
12446
12452
  return (symbol.flags & 33554432 /* Transient */) !== 0;
12447
12453
  }
12454
+ function isExternalModuleSymbol(moduleSymbol) {
12455
+ return !!(moduleSymbol.flags & 1536 /* Module */) && moduleSymbol.escapedName.charCodeAt(0) === 34 /* doubleQuote */;
12456
+ }
12448
12457
  var stringWriter = createSingleLineStringWriter();
12449
12458
  function createSingleLineStringWriter() {
12450
12459
  var str = "";
@@ -37510,9 +37519,7 @@ function convertToTSConfig(configParseResult, configFileName, host) {
37510
37519
  return config;
37511
37520
  }
37512
37521
  function optionMapToObject(optionMap) {
37513
- return {
37514
- ...arrayFrom(optionMap.entries()).reduce((prev, cur) => ({ ...prev, [cur[0]]: cur[1] }), {})
37515
- };
37522
+ return Object.fromEntries(optionMap);
37516
37523
  }
37517
37524
  function filterSameAsDefaultInclude(specs) {
37518
37525
  if (!length(specs)) return void 0;
@@ -45452,6 +45459,7 @@ function createTypeChecker(host) {
45452
45459
  getNumberType: () => numberType,
45453
45460
  getNumberLiteralType,
45454
45461
  getBigIntType: () => bigintType,
45462
+ getBigIntLiteralType,
45455
45463
  createPromiseType,
45456
45464
  createArrayType,
45457
45465
  getElementTypeOfArrayType,
@@ -52006,7 +52014,7 @@ function createTypeChecker(host) {
52006
52014
  /*yieldModuleSymbol*/
52007
52015
  true
52008
52016
  )[0];
52009
- if (parentSymbol && parentSymbol.flags & 1536 /* Module */) {
52017
+ if (parentSymbol && isExternalModuleSymbol(parentSymbol)) {
52010
52018
  name = getSpecifierForModuleSymbol(parentSymbol, context);
52011
52019
  } else {
52012
52020
  const targetFile = getExternalModuleFileFromDeclaration(parent);
@@ -60187,7 +60195,7 @@ function createTypeChecker(host) {
60187
60195
  }
60188
60196
  if (everyType(objectType, isTupleType) && isNumericLiteralName(propName)) {
60189
60197
  const index = +propName;
60190
- if (accessNode && everyType(objectType, (t) => !t.target.hasRestElement) && !(accessFlags & 16 /* NoTupleBoundsCheck */)) {
60198
+ if (accessNode && everyType(objectType, (t) => !(t.target.combinedFlags & 12 /* Variable */)) && !(accessFlags & 16 /* NoTupleBoundsCheck */)) {
60191
60199
  const indexNode = getIndexNodeForAccessExpression(accessNode);
60192
60200
  if (isTupleType(objectType)) {
60193
60201
  if (index < 0) {
@@ -66327,7 +66335,7 @@ function createTypeChecker(host) {
66327
66335
  return firstOrUndefinedIterator(getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties));
66328
66336
  }
66329
66337
  function tupleTypesDefinitelyUnrelated(source, target) {
66330
- return !(target.target.combinedFlags & 8 /* Variadic */) && target.target.minLength > source.target.minLength || !target.target.hasRestElement && (source.target.hasRestElement || target.target.fixedLength < source.target.fixedLength);
66338
+ return !(target.target.combinedFlags & 8 /* Variadic */) && target.target.minLength > source.target.minLength || !(target.target.combinedFlags & 12 /* Variable */) && (!!(source.target.combinedFlags & 12 /* Variable */) || target.target.fixedLength < source.target.fixedLength);
66331
66339
  }
66332
66340
  function typesDefinitelyUnrelated(source, target) {
66333
66341
  return isTupleType(source) && isTupleType(target) ? tupleTypesDefinitelyUnrelated(source, target) : !!getUnmatchedProperty(
@@ -66416,7 +66424,7 @@ function createTypeChecker(host) {
66416
66424
  return false;
66417
66425
  }
66418
66426
  function inferTypesFromTemplateLiteralType(source, target) {
66419
- return source.flags & 128 /* StringLiteral */ ? inferFromLiteralPartsToTemplateLiteral([source.value], emptyArray, target) : source.flags & 134217728 /* TemplateLiteral */ ? arraysEqual(source.texts, target.texts) ? map(source.types, (s, i) => {
66427
+ return source.flags & 128 /* StringLiteral */ ? inferFromLiteralPartsToTemplateLiteral([source.value], emptyArray, target) : source.flags & 134217728 /* TemplateLiteral */ ? arrayIsEqualTo(source.texts, target.texts) ? map(source.types, (s, i) => {
66420
66428
  return isTypeAssignableTo(getBaseConstraintOrType(s), getBaseConstraintOrType(target.types[i])) ? s : getStringLikeTypeForType(s);
66421
66429
  }) : inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) : void 0;
66422
66430
  }
@@ -66945,7 +66953,7 @@ function createTypeChecker(host) {
66945
66953
  return;
66946
66954
  }
66947
66955
  const startLength = isTupleType(source) ? Math.min(source.target.fixedLength, target.target.fixedLength) : 0;
66948
- const endLength = Math.min(isTupleType(source) ? getEndElementCount(source.target, 3 /* Fixed */) : 0, target.target.hasRestElement ? getEndElementCount(target.target, 3 /* Fixed */) : 0);
66956
+ const endLength = Math.min(isTupleType(source) ? getEndElementCount(source.target, 3 /* Fixed */) : 0, target.target.combinedFlags & 12 /* Variable */ ? getEndElementCount(target.target, 3 /* Fixed */) : 0);
66949
66957
  for (let i = 0; i < startLength; i++) {
66950
66958
  inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);
66951
66959
  }
@@ -66966,7 +66974,7 @@ function createTypeChecker(host) {
66966
66974
  } else if (elementFlags[startLength] & 8 /* Variadic */ && elementFlags[startLength + 1] & 4 /* Rest */) {
66967
66975
  const param = (_a = getInferenceInfoForType(elementTypes[startLength])) == null ? void 0 : _a.typeParameter;
66968
66976
  const constraint = param && getBaseConstraintOfType(param);
66969
- if (constraint && isTupleType(constraint) && !constraint.target.hasRestElement) {
66977
+ if (constraint && isTupleType(constraint) && !(constraint.target.combinedFlags & 12 /* Variable */)) {
66970
66978
  const impliedArity = constraint.target.fixedLength;
66971
66979
  inferFromTypes(sliceTupleType(source, startLength, sourceArity - (startLength + impliedArity)), elementTypes[startLength]);
66972
66980
  inferFromTypes(getElementTypeOfSliceOfTupleType(source, startLength + impliedArity, endLength), elementTypes[startLength + 1]);
@@ -66974,7 +66982,7 @@ function createTypeChecker(host) {
66974
66982
  } else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */) {
66975
66983
  const param = (_b = getInferenceInfoForType(elementTypes[startLength + 1])) == null ? void 0 : _b.typeParameter;
66976
66984
  const constraint = param && getBaseConstraintOfType(param);
66977
- if (constraint && isTupleType(constraint) && !constraint.target.hasRestElement) {
66985
+ if (constraint && isTupleType(constraint) && !(constraint.target.combinedFlags & 12 /* Variable */)) {
66978
66986
  const impliedArity = constraint.target.fixedLength;
66979
66987
  const endIndex = sourceArity - getEndElementCount(target.target, 3 /* Fixed */);
66980
66988
  const startIndex = endIndex - impliedArity;
@@ -67126,7 +67134,7 @@ function createTypeChecker(host) {
67126
67134
  const inferredCovariantType = inference.candidates ? getCovariantInference(inference, context.signature) : void 0;
67127
67135
  const inferredContravariantType = inference.contraCandidates ? getContravariantInference(inference) : void 0;
67128
67136
  if (inferredCovariantType || inferredContravariantType) {
67129
- const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType))));
67137
+ const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & (131072 /* Never */ | 1 /* Any */)) && some(inference.contraCandidates, (t) => isTypeAssignableTo(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeAssignableTo(t, inferredCovariantType))));
67130
67138
  inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
67131
67139
  fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
67132
67140
  } else if (context.flags & 1 /* NoDefault */) {
@@ -68580,7 +68588,7 @@ function createTypeChecker(host) {
68580
68588
  return getEvolvingArrayType(getUnionType(map(types, getElementTypeOfEvolvingArrayType)));
68581
68589
  }
68582
68590
  const result = recombineUnknownType(getUnionType(sameMap(types, finalizeEvolvingArrayType), subtypeReduction));
68583
- if (result !== declaredType && result.flags & declaredType.flags & 1048576 /* Union */ && arraysEqual(result.types, declaredType.types)) {
68591
+ if (result !== declaredType && result.flags & declaredType.flags & 1048576 /* Union */ && arrayIsEqualTo(result.types, declaredType.types)) {
68584
68592
  return declaredType;
68585
68593
  }
68586
68594
  return result;
@@ -70985,7 +70993,7 @@ function createTypeChecker(host) {
70985
70993
  return removeMissingType(getTypeArguments(t)[index], !!(t.target.elementFlags[index] && 2 /* Optional */));
70986
70994
  }
70987
70995
  const offset = length2 !== void 0 && (lastSpreadIndex === void 0 || index > lastSpreadIndex) ? length2 - index : 0;
70988
- const fixedEndLength = offset > 0 && t.target.hasRestElement ? getEndElementCount(t.target, 3 /* Fixed */) : 0;
70996
+ const fixedEndLength = offset > 0 && t.target.combinedFlags & 12 /* Variable */ ? getEndElementCount(t.target, 3 /* Fixed */) : 0;
70989
70997
  if (offset > 0 && offset <= fixedEndLength) {
70990
70998
  return getTypeArguments(t)[getTypeReferenceArity(t) - offset];
70991
70999
  }
@@ -75815,7 +75823,7 @@ function createTypeChecker(host) {
75815
75823
  if (signatureHasRestParameter(signature)) {
75816
75824
  const restType = getTypeOfSymbol(signature.parameters[paramCount]);
75817
75825
  const index = pos - paramCount;
75818
- if (!isTupleType(restType) || restType.target.hasRestElement || index < restType.target.fixedLength) {
75826
+ if (!isTupleType(restType) || restType.target.combinedFlags & 12 /* Variable */ || index < restType.target.fixedLength) {
75819
75827
  return getIndexedAccessType(restType, getNumberLiteralType(index));
75820
75828
  }
75821
75829
  }
@@ -75853,7 +75861,7 @@ function createTypeChecker(host) {
75853
75861
  if (signatureHasRestParameter(signature)) {
75854
75862
  const restType = getTypeOfSymbol(signature.parameters[length2 - 1]);
75855
75863
  if (isTupleType(restType)) {
75856
- return length2 + restType.target.fixedLength - (restType.target.hasRestElement ? 0 : 1);
75864
+ return length2 + restType.target.fixedLength - (restType.target.combinedFlags & 12 /* Variable */ ? 0 : 1);
75857
75865
  }
75858
75866
  }
75859
75867
  return length2;
@@ -75896,7 +75904,7 @@ function createTypeChecker(host) {
75896
75904
  function hasEffectiveRestParameter(signature) {
75897
75905
  if (signatureHasRestParameter(signature)) {
75898
75906
  const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);
75899
- return !isTupleType(restType) || restType.target.hasRestElement;
75907
+ return !isTupleType(restType) || !!(restType.target.combinedFlags & 12 /* Variable */);
75900
75908
  }
75901
75909
  return false;
75902
75910
  }
@@ -75906,7 +75914,7 @@ function createTypeChecker(host) {
75906
75914
  if (!isTupleType(restType)) {
75907
75915
  return isTypeAny(restType) ? anyArrayType : restType;
75908
75916
  }
75909
- if (restType.target.hasRestElement) {
75917
+ if (restType.target.combinedFlags & 12 /* Variable */) {
75910
75918
  return sliceTupleType(restType, restType.target.fixedLength);
75911
75919
  }
75912
75920
  }
@@ -78111,7 +78119,7 @@ function createTypeChecker(host) {
78111
78119
  void 0,
78112
78120
  checkMode || 0 /* Normal */
78113
78121
  ) : checkExpressionCached(initializer, checkMode));
78114
- return isParameter(declaration) && declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
78122
+ return isParameter(declaration) && declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type) && !(type.target.combinedFlags & 12 /* Variable */) && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
78115
78123
  }
78116
78124
  function padTupleType(type, pattern) {
78117
78125
  const patternElements = pattern.elements;
@@ -120128,7 +120136,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
120128
120136
  if (file.hasNoDefaultLib) {
120129
120137
  return true;
120130
120138
  }
120131
- if (!options.noLib) {
120139
+ if (options.noLib) {
120132
120140
  return false;
120133
120141
  }
120134
120142
  const equalityComparer = host.useCaseSensitiveFileNames() ? equateStringsCaseSensitive : equateStringsCaseInsensitive;
@@ -125446,7 +125454,7 @@ function createTabularErrorsDisplay(filesInError, host) {
125446
125454
  if (distinctFiles.length === 0) return "";
125447
125455
  const numberLength = (num) => Math.log(num) * Math.LOG10E + 1;
125448
125456
  const fileToErrorCount = distinctFiles.map((file) => [file, countWhere(filesInError, (fileInError) => fileInError.fileName === file.fileName)]);
125449
- const maxErrors = fileToErrorCount.reduce((acc, value) => Math.max(acc, value[1] || 0), 0);
125457
+ const maxErrors = maxBy(fileToErrorCount, 0, (value) => value[1]);
125450
125458
  const headerRow = Diagnostics.Errors_Files.message;
125451
125459
  const leftColumnHeadingLength = headerRow.split(" ")[0].length;
125452
125460
  const leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));