@typescript-deploys/pr-build 5.2.0-pr-54922-6 → 5.2.0-pr-49218-24

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.2";
21
- var version = `${versionMajorMinor}.0-insiders.20230707`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230710`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -59467,7 +59467,37 @@ function createTypeChecker(host) {
59467
59467
  const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
59468
59468
  for (let i = 0; i < paramCount; i++) {
59469
59469
  const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
59470
- const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
59470
+ let targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
59471
+ if (i === restIndex && targetType && sourceType && isTupleType(sourceType)) {
59472
+ targetType = mapType(targetType, (t) => {
59473
+ if (!isTupleType(t) || // When both sides are tuples of the same structure, we don't want to "propagate" types from elements of variable positions
59474
+ // to the following positions as that would disallow signatures of the exact same structures when trailing fixed elements are involved:
59475
+ //
59476
+ // let fn: (...rest: [...string[], number]) => void = (...rest: [...string[], number]) => {}; // ok
59477
+ //
59478
+ // Since we want to allow contextual types to flow into paremeters, we don't need to differentiate between rest and variadic elements
59479
+ // as that doesn't affect the contextual type of the parameter
59480
+ isTupleTypeStructureMatching(sourceType, t, 2 /* MatchVariable */)) {
59481
+ return t;
59482
+ }
59483
+ const elementTypes = [];
59484
+ const elementFlags = [];
59485
+ const sourceArity = getTypeReferenceArity(sourceType);
59486
+ const targetArity = getTypeReferenceArity(t);
59487
+ for (let i2 = 0; i2 < sourceArity; i2++) {
59488
+ if (i2 >= targetArity) {
59489
+ if (sourceType.target.elementFlags[i2] & 3 /* Fixed */) {
59490
+ elementTypes.push(undefinedType);
59491
+ elementFlags.push(sourceType.target.elementFlags[i2]);
59492
+ }
59493
+ continue;
59494
+ }
59495
+ elementTypes.push(getTupleElementType(t, i2));
59496
+ elementFlags.push(sourceType.target.elementFlags[i2]);
59497
+ }
59498
+ return createTupleType(elementTypes, elementFlags);
59499
+ });
59500
+ }
59471
59501
  if (sourceType && targetType) {
59472
59502
  const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
59473
59503
  const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
@@ -62650,8 +62680,11 @@ function createTypeChecker(host) {
62650
62680
  }
62651
62681
  return void 0;
62652
62682
  }
62653
- function isTupleTypeStructureMatching(t1, t2) {
62654
- return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f, i) => (f & 12 /* Variable */) === (t2.target.elementFlags[i] & 12 /* Variable */));
62683
+ function isTupleTypeStructureMatching(t1, t2, tupleStructureComparisonKind) {
62684
+ return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f1, i) => {
62685
+ const f2 = t2.target.elementFlags[i];
62686
+ return f1 === f2 || !!(tupleStructureComparisonKind & 1 /* MatchFixed */ && f1 & 3 /* Fixed */ && f2 & 3 /* Fixed */) || !!(tupleStructureComparisonKind & 2 /* MatchVariable */ && f1 & 12 /* Variable */ && f2 & 12 /* Variable */);
62687
+ });
62655
62688
  }
62656
62689
  function isZeroBigInt({ value }) {
62657
62690
  return value.base10Value === "0";
@@ -63847,7 +63880,7 @@ function createTypeChecker(host) {
63847
63880
  const targetArity = getTypeReferenceArity(target);
63848
63881
  const elementTypes = getTypeArguments(target);
63849
63882
  const elementFlags = target.target.elementFlags;
63850
- if (isTupleType(source) && isTupleTypeStructureMatching(source, target)) {
63883
+ if (isTupleType(source) && isTupleTypeStructureMatching(source, target, 1 /* MatchFixed */)) {
63851
63884
  for (let i = 0; i < targetArity; i++) {
63852
63885
  inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);
63853
63886
  }
@@ -118420,9 +118453,6 @@ function parseConfigHostFromCompilerHostLike(host, directoryStructureHost = host
118420
118453
  return directoryStructureHost.readDirectory(root, extensions, excludes, includes, depth);
118421
118454
  },
118422
118455
  readFile: (f) => directoryStructureHost.readFile(f),
118423
- directoryExists: maybeBind(directoryStructureHost, directoryStructureHost.directoryExists),
118424
- getDirectories: maybeBind(directoryStructureHost, directoryStructureHost.getDirectories),
118425
- realpath: maybeBind(directoryStructureHost, directoryStructureHost.realpath),
118426
118456
  useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),
118427
118457
  getCurrentDirectory: () => host.getCurrentDirectory(),
118428
118458
  onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || returnUndefined,
package/lib/tsserver.js CHANGED
@@ -2327,7 +2327,7 @@ module.exports = __toCommonJS(server_exports);
2327
2327
 
2328
2328
  // src/compiler/corePublic.ts
2329
2329
  var versionMajorMinor = "5.2";
2330
- var version = `${versionMajorMinor}.0-insiders.20230707`;
2330
+ var version = `${versionMajorMinor}.0-insiders.20230710`;
2331
2331
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2332
2332
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2333
2333
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -64174,7 +64174,37 @@ function createTypeChecker(host) {
64174
64174
  const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
64175
64175
  for (let i = 0; i < paramCount; i++) {
64176
64176
  const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
64177
- const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
64177
+ let targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
64178
+ if (i === restIndex && targetType && sourceType && isTupleType(sourceType)) {
64179
+ targetType = mapType(targetType, (t) => {
64180
+ if (!isTupleType(t) || // When both sides are tuples of the same structure, we don't want to "propagate" types from elements of variable positions
64181
+ // to the following positions as that would disallow signatures of the exact same structures when trailing fixed elements are involved:
64182
+ //
64183
+ // let fn: (...rest: [...string[], number]) => void = (...rest: [...string[], number]) => {}; // ok
64184
+ //
64185
+ // Since we want to allow contextual types to flow into paremeters, we don't need to differentiate between rest and variadic elements
64186
+ // as that doesn't affect the contextual type of the parameter
64187
+ isTupleTypeStructureMatching(sourceType, t, 2 /* MatchVariable */)) {
64188
+ return t;
64189
+ }
64190
+ const elementTypes = [];
64191
+ const elementFlags = [];
64192
+ const sourceArity = getTypeReferenceArity(sourceType);
64193
+ const targetArity = getTypeReferenceArity(t);
64194
+ for (let i2 = 0; i2 < sourceArity; i2++) {
64195
+ if (i2 >= targetArity) {
64196
+ if (sourceType.target.elementFlags[i2] & 3 /* Fixed */) {
64197
+ elementTypes.push(undefinedType);
64198
+ elementFlags.push(sourceType.target.elementFlags[i2]);
64199
+ }
64200
+ continue;
64201
+ }
64202
+ elementTypes.push(getTupleElementType(t, i2));
64203
+ elementFlags.push(sourceType.target.elementFlags[i2]);
64204
+ }
64205
+ return createTupleType(elementTypes, elementFlags);
64206
+ });
64207
+ }
64178
64208
  if (sourceType && targetType) {
64179
64209
  const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
64180
64210
  const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
@@ -67357,8 +67387,11 @@ function createTypeChecker(host) {
67357
67387
  }
67358
67388
  return void 0;
67359
67389
  }
67360
- function isTupleTypeStructureMatching(t1, t2) {
67361
- return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f, i) => (f & 12 /* Variable */) === (t2.target.elementFlags[i] & 12 /* Variable */));
67390
+ function isTupleTypeStructureMatching(t1, t2, tupleStructureComparisonKind) {
67391
+ return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f1, i) => {
67392
+ const f2 = t2.target.elementFlags[i];
67393
+ return f1 === f2 || !!(tupleStructureComparisonKind & 1 /* MatchFixed */ && f1 & 3 /* Fixed */ && f2 & 3 /* Fixed */) || !!(tupleStructureComparisonKind & 2 /* MatchVariable */ && f1 & 12 /* Variable */ && f2 & 12 /* Variable */);
67394
+ });
67362
67395
  }
67363
67396
  function isZeroBigInt({ value }) {
67364
67397
  return value.base10Value === "0";
@@ -68554,7 +68587,7 @@ function createTypeChecker(host) {
68554
68587
  const targetArity = getTypeReferenceArity(target);
68555
68588
  const elementTypes = getTypeArguments(target);
68556
68589
  const elementFlags = target.target.elementFlags;
68557
- if (isTupleType(source) && isTupleTypeStructureMatching(source, target)) {
68590
+ if (isTupleType(source) && isTupleTypeStructureMatching(source, target, 1 /* MatchFixed */)) {
68558
68591
  for (let i = 0; i < targetArity; i++) {
68559
68592
  inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);
68560
68593
  }
@@ -123363,9 +123396,6 @@ function parseConfigHostFromCompilerHostLike(host, directoryStructureHost = host
123363
123396
  return directoryStructureHost.readDirectory(root, extensions, excludes, includes, depth);
123364
123397
  },
123365
123398
  readFile: (f) => directoryStructureHost.readFile(f),
123366
- directoryExists: maybeBind(directoryStructureHost, directoryStructureHost.directoryExists),
123367
- getDirectories: maybeBind(directoryStructureHost, directoryStructureHost.getDirectories),
123368
- realpath: maybeBind(directoryStructureHost, directoryStructureHost.realpath),
123369
123399
  useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),
123370
123400
  getCurrentDirectory: () => host.getCurrentDirectory(),
123371
123401
  onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || returnUndefined,
@@ -130133,6 +130163,8 @@ var ScriptElementKind = /* @__PURE__ */ ((ScriptElementKind2) => {
130133
130163
  ScriptElementKind2["enumMemberElement"] = "enum member";
130134
130164
  ScriptElementKind2["variableElement"] = "var";
130135
130165
  ScriptElementKind2["localVariableElement"] = "local var";
130166
+ ScriptElementKind2["variableUsingElement"] = "using";
130167
+ ScriptElementKind2["variableAwaitUsingElement"] = "await using";
130136
130168
  ScriptElementKind2["functionElement"] = "function";
130137
130169
  ScriptElementKind2["localFunctionElement"] = "local function";
130138
130170
  ScriptElementKind2["memberFunctionElement"] = "method";
@@ -132868,13 +132900,16 @@ function needsNameFromDeclaration(symbol) {
132868
132900
  return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */);
132869
132901
  }
132870
132902
  function getDefaultLikeExportNameFromDeclaration(symbol) {
132871
- return firstDefined(
132872
- symbol.declarations,
132873
- (d) => {
132874
- var _a, _b;
132875
- return isExportAssignment(d) ? (_a = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text;
132903
+ return firstDefined(symbol.declarations, (d) => {
132904
+ var _a, _b, _c;
132905
+ if (isExportAssignment(d)) {
132906
+ return (_a = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a.text;
132876
132907
  }
132877
- );
132908
+ if (isExportSpecifier(d) && d.symbol.flags === 2097152 /* Alias */) {
132909
+ return (_b = tryCast(d.propertyName, isIdentifier)) == null ? void 0 : _b.text;
132910
+ }
132911
+ return (_c = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _c.text;
132912
+ });
132878
132913
  }
132879
132914
  function getSymbolParentOrFail(symbol) {
132880
132915
  var _a;
@@ -143743,9 +143778,6 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
143743
143778
  useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
143744
143779
  fileExists: (fileName) => compilerHost.fileExists(fileName),
143745
143780
  readFile: (fileName) => compilerHost.readFile(fileName),
143746
- directoryExists: (f) => compilerHost.directoryExists(f),
143747
- getDirectories: (f) => compilerHost.getDirectories(f),
143748
- realpath: compilerHost.realpath,
143749
143781
  readDirectory: (...args) => compilerHost.readDirectory(...args),
143750
143782
  trace: compilerHost.trace,
143751
143783
  getCurrentDirectory: compilerHost.getCurrentDirectory,
@@ -167126,6 +167158,10 @@ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeCheck
167126
167158
  return "parameter" /* parameterElement */;
167127
167159
  } else if (symbol.valueDeclaration && isVarConst(symbol.valueDeclaration)) {
167128
167160
  return "const" /* constElement */;
167161
+ } else if (symbol.valueDeclaration && isVarUsing(symbol.valueDeclaration)) {
167162
+ return "using" /* variableUsingElement */;
167163
+ } else if (symbol.valueDeclaration && isVarAwaitUsing(symbol.valueDeclaration)) {
167164
+ return "await using" /* variableAwaitUsingElement */;
167129
167165
  } else if (forEach(symbol.declarations, isLet)) {
167130
167166
  return "let" /* letElement */;
167131
167167
  }
@@ -167519,7 +167555,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
167519
167555
  } else {
167520
167556
  addPrefixForAnyFunctionOrVar(symbol, symbolKind);
167521
167557
  }
167522
- if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || isThisExpression) {
167558
+ if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || symbolKind === "using" /* variableUsingElement */ || symbolKind === "await using" /* variableAwaitUsingElement */ || isThisExpression) {
167523
167559
  displayParts.push(punctuationPart(59 /* ColonToken */));
167524
167560
  displayParts.push(spacePart());
167525
167561
  if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */ && symbolKind !== "index" /* indexSignatureElement */) {
@@ -167669,6 +167705,8 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
167669
167705
  case "let" /* letElement */:
167670
167706
  case "const" /* constElement */:
167671
167707
  case "constructor" /* constructorImplementationElement */:
167708
+ case "using" /* variableUsingElement */:
167709
+ case "await using" /* variableAwaitUsingElement */:
167672
167710
  displayParts.push(textOrKeywordPart(symbolKind2));
167673
167711
  return;
167674
167712
  default:
@@ -6274,7 +6274,7 @@ declare namespace ts {
6274
6274
  getSourceFileByPath(path: Path): SourceFile | undefined;
6275
6275
  getCurrentDirectory(): string;
6276
6276
  }
6277
- interface ParseConfigHost extends ModuleResolutionHost {
6277
+ interface ParseConfigHost {
6278
6278
  useCaseSensitiveFileNames: boolean;
6279
6279
  readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): readonly string[];
6280
6280
  /**
@@ -10978,6 +10978,10 @@ declare namespace ts {
10978
10978
  variableElement = "var",
10979
10979
  /** Inside function */
10980
10980
  localVariableElement = "local var",
10981
+ /** using foo = ... */
10982
+ variableUsingElement = "using",
10983
+ /** await using foo = ... */
10984
+ variableAwaitUsingElement = "await using",
10981
10985
  /**
10982
10986
  * Inside module and script only
10983
10987
  * function f() { }
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-insiders.20230707`;
38
+ version = `${versionMajorMinor}.0-insiders.20230710`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -61941,7 +61941,37 @@ ${lanes.join("\n")}
61941
61941
  const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
61942
61942
  for (let i = 0; i < paramCount; i++) {
61943
61943
  const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
61944
- const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
61944
+ let targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
61945
+ if (i === restIndex && targetType && sourceType && isTupleType(sourceType)) {
61946
+ targetType = mapType(targetType, (t) => {
61947
+ if (!isTupleType(t) || // When both sides are tuples of the same structure, we don't want to "propagate" types from elements of variable positions
61948
+ // to the following positions as that would disallow signatures of the exact same structures when trailing fixed elements are involved:
61949
+ //
61950
+ // let fn: (...rest: [...string[], number]) => void = (...rest: [...string[], number]) => {}; // ok
61951
+ //
61952
+ // Since we want to allow contextual types to flow into paremeters, we don't need to differentiate between rest and variadic elements
61953
+ // as that doesn't affect the contextual type of the parameter
61954
+ isTupleTypeStructureMatching(sourceType, t, 2 /* MatchVariable */)) {
61955
+ return t;
61956
+ }
61957
+ const elementTypes = [];
61958
+ const elementFlags = [];
61959
+ const sourceArity = getTypeReferenceArity(sourceType);
61960
+ const targetArity = getTypeReferenceArity(t);
61961
+ for (let i2 = 0; i2 < sourceArity; i2++) {
61962
+ if (i2 >= targetArity) {
61963
+ if (sourceType.target.elementFlags[i2] & 3 /* Fixed */) {
61964
+ elementTypes.push(undefinedType);
61965
+ elementFlags.push(sourceType.target.elementFlags[i2]);
61966
+ }
61967
+ continue;
61968
+ }
61969
+ elementTypes.push(getTupleElementType(t, i2));
61970
+ elementFlags.push(sourceType.target.elementFlags[i2]);
61971
+ }
61972
+ return createTupleType(elementTypes, elementFlags);
61973
+ });
61974
+ }
61945
61975
  if (sourceType && targetType) {
61946
61976
  const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
61947
61977
  const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
@@ -65124,8 +65154,11 @@ ${lanes.join("\n")}
65124
65154
  }
65125
65155
  return void 0;
65126
65156
  }
65127
- function isTupleTypeStructureMatching(t1, t2) {
65128
- return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f, i) => (f & 12 /* Variable */) === (t2.target.elementFlags[i] & 12 /* Variable */));
65157
+ function isTupleTypeStructureMatching(t1, t2, tupleStructureComparisonKind) {
65158
+ return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f1, i) => {
65159
+ const f2 = t2.target.elementFlags[i];
65160
+ return f1 === f2 || !!(tupleStructureComparisonKind & 1 /* MatchFixed */ && f1 & 3 /* Fixed */ && f2 & 3 /* Fixed */) || !!(tupleStructureComparisonKind & 2 /* MatchVariable */ && f1 & 12 /* Variable */ && f2 & 12 /* Variable */);
65161
+ });
65129
65162
  }
65130
65163
  function isZeroBigInt({ value }) {
65131
65164
  return value.base10Value === "0";
@@ -66321,7 +66354,7 @@ ${lanes.join("\n")}
66321
66354
  const targetArity = getTypeReferenceArity(target);
66322
66355
  const elementTypes = getTypeArguments(target);
66323
66356
  const elementFlags = target.target.elementFlags;
66324
- if (isTupleType(source) && isTupleTypeStructureMatching(source, target)) {
66357
+ if (isTupleType(source) && isTupleTypeStructureMatching(source, target, 1 /* MatchFixed */)) {
66325
66358
  for (let i = 0; i < targetArity; i++) {
66326
66359
  inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);
66327
66360
  }
@@ -121348,9 +121381,6 @@ ${lanes.join("\n")}
121348
121381
  return directoryStructureHost.readDirectory(root, extensions, excludes, includes, depth);
121349
121382
  },
121350
121383
  readFile: (f) => directoryStructureHost.readFile(f),
121351
- directoryExists: maybeBind(directoryStructureHost, directoryStructureHost.directoryExists),
121352
- getDirectories: maybeBind(directoryStructureHost, directoryStructureHost.getDirectories),
121353
- realpath: maybeBind(directoryStructureHost, directoryStructureHost.realpath),
121354
121384
  useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),
121355
121385
  getCurrentDirectory: () => host.getCurrentDirectory(),
121356
121386
  onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || returnUndefined,
@@ -128439,6 +128469,8 @@ ${lanes.join("\n")}
128439
128469
  ScriptElementKind2["enumMemberElement"] = "enum member";
128440
128470
  ScriptElementKind2["variableElement"] = "var";
128441
128471
  ScriptElementKind2["localVariableElement"] = "local var";
128472
+ ScriptElementKind2["variableUsingElement"] = "using";
128473
+ ScriptElementKind2["variableAwaitUsingElement"] = "await using";
128442
128474
  ScriptElementKind2["functionElement"] = "function";
128443
128475
  ScriptElementKind2["localFunctionElement"] = "local function";
128444
128476
  ScriptElementKind2["memberFunctionElement"] = "method";
@@ -131126,13 +131158,16 @@ ${lanes.join("\n")}
131126
131158
  return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */);
131127
131159
  }
131128
131160
  function getDefaultLikeExportNameFromDeclaration(symbol) {
131129
- return firstDefined(
131130
- symbol.declarations,
131131
- (d) => {
131132
- var _a, _b;
131133
- return isExportAssignment(d) ? (_a = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text;
131161
+ return firstDefined(symbol.declarations, (d) => {
131162
+ var _a, _b, _c;
131163
+ if (isExportAssignment(d)) {
131164
+ return (_a = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a.text;
131134
131165
  }
131135
- );
131166
+ if (isExportSpecifier(d) && d.symbol.flags === 2097152 /* Alias */) {
131167
+ return (_b = tryCast(d.propertyName, isIdentifier)) == null ? void 0 : _b.text;
131168
+ }
131169
+ return (_c = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _c.text;
131170
+ });
131136
131171
  }
131137
131172
  function getSymbolParentOrFail(symbol) {
131138
131173
  var _a;
@@ -141688,9 +141723,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
141688
141723
  useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
141689
141724
  fileExists: (fileName) => compilerHost.fileExists(fileName),
141690
141725
  readFile: (fileName) => compilerHost.readFile(fileName),
141691
- directoryExists: (f) => compilerHost.directoryExists(f),
141692
- getDirectories: (f) => compilerHost.getDirectories(f),
141693
- realpath: compilerHost.realpath,
141694
141726
  readDirectory: (...args) => compilerHost.readDirectory(...args),
141695
141727
  trace: compilerHost.trace,
141696
141728
  getCurrentDirectory: compilerHost.getCurrentDirectory,
@@ -166567,6 +166599,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166567
166599
  return "parameter" /* parameterElement */;
166568
166600
  } else if (symbol.valueDeclaration && isVarConst(symbol.valueDeclaration)) {
166569
166601
  return "const" /* constElement */;
166602
+ } else if (symbol.valueDeclaration && isVarUsing(symbol.valueDeclaration)) {
166603
+ return "using" /* variableUsingElement */;
166604
+ } else if (symbol.valueDeclaration && isVarAwaitUsing(symbol.valueDeclaration)) {
166605
+ return "await using" /* variableAwaitUsingElement */;
166570
166606
  } else if (forEach(symbol.declarations, isLet)) {
166571
166607
  return "let" /* letElement */;
166572
166608
  }
@@ -166960,7 +166996,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166960
166996
  } else {
166961
166997
  addPrefixForAnyFunctionOrVar(symbol, symbolKind);
166962
166998
  }
166963
- if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || isThisExpression) {
166999
+ if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || symbolKind === "using" /* variableUsingElement */ || symbolKind === "await using" /* variableAwaitUsingElement */ || isThisExpression) {
166964
167000
  displayParts.push(punctuationPart(59 /* ColonToken */));
166965
167001
  displayParts.push(spacePart());
166966
167002
  if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */ && symbolKind !== "index" /* indexSignatureElement */) {
@@ -167110,6 +167146,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
167110
167146
  case "let" /* letElement */:
167111
167147
  case "const" /* constElement */:
167112
167148
  case "constructor" /* constructorImplementationElement */:
167149
+ case "using" /* variableUsingElement */:
167150
+ case "await using" /* variableAwaitUsingElement */:
167113
167151
  displayParts.push(textOrKeywordPart(symbolKind2));
167114
167152
  return;
167115
167153
  default:
@@ -2221,7 +2221,7 @@ declare namespace ts {
2221
2221
  getSourceFileByPath(path: Path): SourceFile | undefined;
2222
2222
  getCurrentDirectory(): string;
2223
2223
  }
2224
- interface ParseConfigHost extends ModuleResolutionHost {
2224
+ interface ParseConfigHost {
2225
2225
  useCaseSensitiveFileNames: boolean;
2226
2226
  readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number): readonly string[];
2227
2227
  /**
@@ -7009,6 +7009,10 @@ declare namespace ts {
7009
7009
  variableElement = "var",
7010
7010
  /** Inside function */
7011
7011
  localVariableElement = "local var",
7012
+ /** using foo = ... */
7013
+ variableUsingElement = "using",
7014
+ /** await using foo = ... */
7015
+ variableAwaitUsingElement = "await using",
7012
7016
  /**
7013
7017
  * Inside module and script only
7014
7018
  * function f() { }
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-insiders.20230707`;
38
+ version = `${versionMajorMinor}.0-insiders.20230710`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -61941,7 +61941,37 @@ ${lanes.join("\n")}
61941
61941
  const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
61942
61942
  for (let i = 0; i < paramCount; i++) {
61943
61943
  const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
61944
- const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
61944
+ let targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
61945
+ if (i === restIndex && targetType && sourceType && isTupleType(sourceType)) {
61946
+ targetType = mapType(targetType, (t) => {
61947
+ if (!isTupleType(t) || // When both sides are tuples of the same structure, we don't want to "propagate" types from elements of variable positions
61948
+ // to the following positions as that would disallow signatures of the exact same structures when trailing fixed elements are involved:
61949
+ //
61950
+ // let fn: (...rest: [...string[], number]) => void = (...rest: [...string[], number]) => {}; // ok
61951
+ //
61952
+ // Since we want to allow contextual types to flow into paremeters, we don't need to differentiate between rest and variadic elements
61953
+ // as that doesn't affect the contextual type of the parameter
61954
+ isTupleTypeStructureMatching(sourceType, t, 2 /* MatchVariable */)) {
61955
+ return t;
61956
+ }
61957
+ const elementTypes = [];
61958
+ const elementFlags = [];
61959
+ const sourceArity = getTypeReferenceArity(sourceType);
61960
+ const targetArity = getTypeReferenceArity(t);
61961
+ for (let i2 = 0; i2 < sourceArity; i2++) {
61962
+ if (i2 >= targetArity) {
61963
+ if (sourceType.target.elementFlags[i2] & 3 /* Fixed */) {
61964
+ elementTypes.push(undefinedType);
61965
+ elementFlags.push(sourceType.target.elementFlags[i2]);
61966
+ }
61967
+ continue;
61968
+ }
61969
+ elementTypes.push(getTupleElementType(t, i2));
61970
+ elementFlags.push(sourceType.target.elementFlags[i2]);
61971
+ }
61972
+ return createTupleType(elementTypes, elementFlags);
61973
+ });
61974
+ }
61945
61975
  if (sourceType && targetType) {
61946
61976
  const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
61947
61977
  const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
@@ -65124,8 +65154,11 @@ ${lanes.join("\n")}
65124
65154
  }
65125
65155
  return void 0;
65126
65156
  }
65127
- function isTupleTypeStructureMatching(t1, t2) {
65128
- return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f, i) => (f & 12 /* Variable */) === (t2.target.elementFlags[i] & 12 /* Variable */));
65157
+ function isTupleTypeStructureMatching(t1, t2, tupleStructureComparisonKind) {
65158
+ return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f1, i) => {
65159
+ const f2 = t2.target.elementFlags[i];
65160
+ return f1 === f2 || !!(tupleStructureComparisonKind & 1 /* MatchFixed */ && f1 & 3 /* Fixed */ && f2 & 3 /* Fixed */) || !!(tupleStructureComparisonKind & 2 /* MatchVariable */ && f1 & 12 /* Variable */ && f2 & 12 /* Variable */);
65161
+ });
65129
65162
  }
65130
65163
  function isZeroBigInt({ value }) {
65131
65164
  return value.base10Value === "0";
@@ -66321,7 +66354,7 @@ ${lanes.join("\n")}
66321
66354
  const targetArity = getTypeReferenceArity(target);
66322
66355
  const elementTypes = getTypeArguments(target);
66323
66356
  const elementFlags = target.target.elementFlags;
66324
- if (isTupleType(source) && isTupleTypeStructureMatching(source, target)) {
66357
+ if (isTupleType(source) && isTupleTypeStructureMatching(source, target, 1 /* MatchFixed */)) {
66325
66358
  for (let i = 0; i < targetArity; i++) {
66326
66359
  inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);
66327
66360
  }
@@ -121348,9 +121381,6 @@ ${lanes.join("\n")}
121348
121381
  return directoryStructureHost.readDirectory(root, extensions, excludes, includes, depth);
121349
121382
  },
121350
121383
  readFile: (f) => directoryStructureHost.readFile(f),
121351
- directoryExists: maybeBind(directoryStructureHost, directoryStructureHost.directoryExists),
121352
- getDirectories: maybeBind(directoryStructureHost, directoryStructureHost.getDirectories),
121353
- realpath: maybeBind(directoryStructureHost, directoryStructureHost.realpath),
121354
121384
  useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),
121355
121385
  getCurrentDirectory: () => host.getCurrentDirectory(),
121356
121386
  onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || returnUndefined,
@@ -128454,6 +128484,8 @@ ${lanes.join("\n")}
128454
128484
  ScriptElementKind2["enumMemberElement"] = "enum member";
128455
128485
  ScriptElementKind2["variableElement"] = "var";
128456
128486
  ScriptElementKind2["localVariableElement"] = "local var";
128487
+ ScriptElementKind2["variableUsingElement"] = "using";
128488
+ ScriptElementKind2["variableAwaitUsingElement"] = "await using";
128457
128489
  ScriptElementKind2["functionElement"] = "function";
128458
128490
  ScriptElementKind2["localFunctionElement"] = "local function";
128459
128491
  ScriptElementKind2["memberFunctionElement"] = "method";
@@ -131141,13 +131173,16 @@ ${lanes.join("\n")}
131141
131173
  return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */);
131142
131174
  }
131143
131175
  function getDefaultLikeExportNameFromDeclaration(symbol) {
131144
- return firstDefined(
131145
- symbol.declarations,
131146
- (d) => {
131147
- var _a, _b;
131148
- return isExportAssignment(d) ? (_a = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text;
131176
+ return firstDefined(symbol.declarations, (d) => {
131177
+ var _a, _b, _c;
131178
+ if (isExportAssignment(d)) {
131179
+ return (_a = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a.text;
131149
131180
  }
131150
- );
131181
+ if (isExportSpecifier(d) && d.symbol.flags === 2097152 /* Alias */) {
131182
+ return (_b = tryCast(d.propertyName, isIdentifier)) == null ? void 0 : _b.text;
131183
+ }
131184
+ return (_c = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _c.text;
131185
+ });
131151
131186
  }
131152
131187
  function getSymbolParentOrFail(symbol) {
131153
131188
  var _a;
@@ -141703,9 +141738,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
141703
141738
  useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
141704
141739
  fileExists: (fileName) => compilerHost.fileExists(fileName),
141705
141740
  readFile: (fileName) => compilerHost.readFile(fileName),
141706
- directoryExists: (f) => compilerHost.directoryExists(f),
141707
- getDirectories: (f) => compilerHost.getDirectories(f),
141708
- realpath: compilerHost.realpath,
141709
141741
  readDirectory: (...args) => compilerHost.readDirectory(...args),
141710
141742
  trace: compilerHost.trace,
141711
141743
  getCurrentDirectory: compilerHost.getCurrentDirectory,
@@ -166582,6 +166614,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166582
166614
  return "parameter" /* parameterElement */;
166583
166615
  } else if (symbol.valueDeclaration && isVarConst(symbol.valueDeclaration)) {
166584
166616
  return "const" /* constElement */;
166617
+ } else if (symbol.valueDeclaration && isVarUsing(symbol.valueDeclaration)) {
166618
+ return "using" /* variableUsingElement */;
166619
+ } else if (symbol.valueDeclaration && isVarAwaitUsing(symbol.valueDeclaration)) {
166620
+ return "await using" /* variableAwaitUsingElement */;
166585
166621
  } else if (forEach(symbol.declarations, isLet)) {
166586
166622
  return "let" /* letElement */;
166587
166623
  }
@@ -166975,7 +167011,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
166975
167011
  } else {
166976
167012
  addPrefixForAnyFunctionOrVar(symbol, symbolKind);
166977
167013
  }
166978
- if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || isThisExpression) {
167014
+ if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || symbolKind === "using" /* variableUsingElement */ || symbolKind === "await using" /* variableAwaitUsingElement */ || isThisExpression) {
166979
167015
  displayParts.push(punctuationPart(59 /* ColonToken */));
166980
167016
  displayParts.push(spacePart());
166981
167017
  if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */ && symbolKind !== "index" /* indexSignatureElement */) {
@@ -167125,6 +167161,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
167125
167161
  case "let" /* letElement */:
167126
167162
  case "const" /* constElement */:
167127
167163
  case "constructor" /* constructorImplementationElement */:
167164
+ case "using" /* variableUsingElement */:
167165
+ case "await using" /* variableAwaitUsingElement */:
167128
167166
  displayParts.push(textOrKeywordPart(symbolKind2));
167129
167167
  return;
167130
167168
  default:
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.2";
57
- var version = `${versionMajorMinor}.0-insiders.20230707`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230710`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.2.0-pr-54922-6",
5
+ "version": "5.2.0-pr-49218-24",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "163fb7959da8123962233530da125814c6a3f2c3"
118
+ "gitHead": "f606b3c7639589dc74f8db612faba767e394c163"
119
119
  }