@typescript-deploys/pr-build 5.1.0-pr-53489-15 → 5.1.0-pr-53756-16

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/lib.es5.d.ts CHANGED
@@ -332,9 +332,14 @@ interface CallableFunction extends Function {
332
332
  /**
333
333
  * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
334
334
  * @param thisArg The object to be used as the this object.
335
- * @param args An array of argument values to be passed to the function.
336
335
  */
337
336
  apply<T, R>(this: (this: T) => R, thisArg: T): R;
337
+
338
+ /**
339
+ * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
340
+ * @param thisArg The object to be used as the this object.
341
+ * @param args An array of argument values to be passed to the function.
342
+ */
338
343
  apply<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;
339
344
 
340
345
  /**
@@ -348,23 +353,29 @@ interface CallableFunction extends Function {
348
353
  * For a given function, creates a bound function that has the same body as the original function.
349
354
  * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
350
355
  * @param thisArg The object to be used as the this object.
351
- * @param args Arguments to bind to the parameters of the function.
352
356
  */
353
357
  bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;
354
- bind<T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;
355
- bind<T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R;
356
- bind<T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R;
357
- bind<T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R;
358
- bind<T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R;
358
+
359
+ /**
360
+ * For a given function, creates a bound function that has the same body as the original function.
361
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
362
+ * @param thisArg The object to be used as the this object.
363
+ * @param args Arguments to bind to the parameters of the function.
364
+ */
365
+ bind<T, A extends any[], B extends any[], R>(this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R;
359
366
  }
360
367
 
361
368
  interface NewableFunction extends Function {
362
369
  /**
363
370
  * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
364
371
  * @param thisArg The object to be used as the this object.
365
- * @param args An array of argument values to be passed to the function.
366
372
  */
367
373
  apply<T>(this: new () => T, thisArg: T): void;
374
+ /**
375
+ * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
376
+ * @param thisArg The object to be used as the this object.
377
+ * @param args An array of argument values to be passed to the function.
378
+ */
368
379
  apply<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, args: A): void;
369
380
 
370
381
  /**
@@ -378,14 +389,16 @@ interface NewableFunction extends Function {
378
389
  * For a given function, creates a bound function that has the same body as the original function.
379
390
  * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
380
391
  * @param thisArg The object to be used as the this object.
381
- * @param args Arguments to bind to the parameters of the function.
382
392
  */
383
393
  bind<T>(this: T, thisArg: any): T;
384
- bind<A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;
385
- bind<A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R;
386
- bind<A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R;
387
- bind<A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R;
388
- bind<AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R;
394
+
395
+ /**
396
+ * For a given function, creates a bound function that has the same body as the original function.
397
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
398
+ * @param thisArg The object to be used as the this object.
399
+ * @param args Arguments to bind to the parameters of the function.
400
+ */
401
+ bind<A extends any[], B extends any[], R>(this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R;
389
402
  }
390
403
 
391
404
  interface IArguments {
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.1";
21
- var version = `${versionMajorMinor}.0-insiders.20230412`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230413`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -3753,6 +3753,7 @@ var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => {
3753
3753
  SignatureFlags4[SignatureFlags4["IsInnerCallChain"] = 8] = "IsInnerCallChain";
3754
3754
  SignatureFlags4[SignatureFlags4["IsOuterCallChain"] = 16] = "IsOuterCallChain";
3755
3755
  SignatureFlags4[SignatureFlags4["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
3756
+ SignatureFlags4[SignatureFlags4["IsNonInferrable"] = 64] = "IsNonInferrable";
3756
3757
  SignatureFlags4[SignatureFlags4["PropagatingFlags"] = 39] = "PropagatingFlags";
3757
3758
  SignatureFlags4[SignatureFlags4["CallChainFlags"] = 24] = "CallChainFlags";
3758
3759
  return SignatureFlags4;
@@ -44749,11 +44750,6 @@ function createTypeChecker(host) {
44749
44750
  diagnosticMessage = error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
44750
44751
  } else if (result.flags & 256 /* RegularEnum */) {
44751
44752
  diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
44752
- } else {
44753
- Debug.assert(!!(result.flags & 128 /* ConstEnum */));
44754
- if (shouldPreserveConstEnums(compilerOptions)) {
44755
- diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
44756
- }
44757
44753
  }
44758
44754
  if (diagnosticMessage) {
44759
44755
  addRelatedInfo(
@@ -54064,35 +54060,7 @@ function createTypeChecker(host) {
54064
54060
  return emptyArray;
54065
54061
  }
54066
54062
  function getSignaturesOfType(type, kind) {
54067
- const result = getSignaturesOfStructuredType(getReducedApparentType(type), kind);
54068
- if (kind === 0 /* Call */ && !length(result) && type.flags & 1048576 /* Union */) {
54069
- if (type.arrayFallbackSignatures) {
54070
- return type.arrayFallbackSignatures;
54071
- }
54072
- let memberName;
54073
- if (everyType(type, (t) => {
54074
- var _a2;
54075
- return !!((_a2 = t.symbol) == null ? void 0 : _a2.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
54076
- })) {
54077
- const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
54078
- const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
54079
- return type.arrayFallbackSignatures = getSignaturesOfType(getTypeOfPropertyOfType(arrayType, memberName), kind);
54080
- }
54081
- type.arrayFallbackSignatures = result;
54082
- }
54083
- return result;
54084
- }
54085
- function isArrayOrTupleSymbol(symbol) {
54086
- if (!symbol || !globalArrayType.symbol || !globalReadonlyArrayType.symbol) {
54087
- return false;
54088
- }
54089
- return !!getSymbolIfSameReference(symbol, globalArrayType.symbol) || !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
54090
- }
54091
- function isReadonlyArraySymbol(symbol) {
54092
- if (!symbol || !globalReadonlyArrayType.symbol) {
54093
- return false;
54094
- }
54095
- return !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
54063
+ return getSignaturesOfStructuredType(getReducedApparentType(type), kind);
54096
54064
  }
54097
54065
  function findIndexInfo(indexInfos, keyType) {
54098
54066
  return find(indexInfos, (info) => info.keyType === keyType);
@@ -63448,11 +63416,13 @@ function createTypeChecker(host) {
63448
63416
  }
63449
63417
  }
63450
63418
  function inferFromSignature(source, target) {
63451
- const saveBivariant = bivariant;
63452
- const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
63453
- bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
63454
- applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
63455
- bivariant = saveBivariant;
63419
+ if (!(source.flags & 64 /* IsNonInferrable */)) {
63420
+ const saveBivariant = bivariant;
63421
+ const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
63422
+ bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
63423
+ applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
63424
+ bivariant = saveBivariant;
63425
+ }
63456
63426
  applyToReturnTypes(source, target, inferFromTypes);
63457
63427
  }
63458
63428
  function inferFromIndexTypes(source, target) {
@@ -72352,7 +72322,7 @@ function createTypeChecker(host) {
72352
72322
  /*resolvedTypePredicate*/
72353
72323
  void 0,
72354
72324
  0,
72355
- 0 /* None */
72325
+ 64 /* IsNonInferrable */
72356
72326
  );
72357
72327
  const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
72358
72328
  returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
package/lib/tsserver.js CHANGED
@@ -2293,7 +2293,7 @@ module.exports = __toCommonJS(server_exports);
2293
2293
 
2294
2294
  // src/compiler/corePublic.ts
2295
2295
  var versionMajorMinor = "5.1";
2296
- var version = `${versionMajorMinor}.0-insiders.20230412`;
2296
+ var version = `${versionMajorMinor}.0-insiders.20230413`;
2297
2297
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2298
2298
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2299
2299
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6767,6 +6767,7 @@ var SignatureFlags = /* @__PURE__ */ ((SignatureFlags5) => {
6767
6767
  SignatureFlags5[SignatureFlags5["IsInnerCallChain"] = 8] = "IsInnerCallChain";
6768
6768
  SignatureFlags5[SignatureFlags5["IsOuterCallChain"] = 16] = "IsOuterCallChain";
6769
6769
  SignatureFlags5[SignatureFlags5["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
6770
+ SignatureFlags5[SignatureFlags5["IsNonInferrable"] = 64] = "IsNonInferrable";
6770
6771
  SignatureFlags5[SignatureFlags5["PropagatingFlags"] = 39] = "PropagatingFlags";
6771
6772
  SignatureFlags5[SignatureFlags5["CallChainFlags"] = 24] = "CallChainFlags";
6772
6773
  return SignatureFlags5;
@@ -49399,11 +49400,6 @@ function createTypeChecker(host) {
49399
49400
  diagnosticMessage = error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
49400
49401
  } else if (result.flags & 256 /* RegularEnum */) {
49401
49402
  diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
49402
- } else {
49403
- Debug.assert(!!(result.flags & 128 /* ConstEnum */));
49404
- if (shouldPreserveConstEnums(compilerOptions)) {
49405
- diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
49406
- }
49407
49403
  }
49408
49404
  if (diagnosticMessage) {
49409
49405
  addRelatedInfo(
@@ -58714,35 +58710,7 @@ function createTypeChecker(host) {
58714
58710
  return emptyArray;
58715
58711
  }
58716
58712
  function getSignaturesOfType(type, kind) {
58717
- const result = getSignaturesOfStructuredType(getReducedApparentType(type), kind);
58718
- if (kind === 0 /* Call */ && !length(result) && type.flags & 1048576 /* Union */) {
58719
- if (type.arrayFallbackSignatures) {
58720
- return type.arrayFallbackSignatures;
58721
- }
58722
- let memberName;
58723
- if (everyType(type, (t) => {
58724
- var _a2;
58725
- return !!((_a2 = t.symbol) == null ? void 0 : _a2.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
58726
- })) {
58727
- const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
58728
- const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
58729
- return type.arrayFallbackSignatures = getSignaturesOfType(getTypeOfPropertyOfType(arrayType, memberName), kind);
58730
- }
58731
- type.arrayFallbackSignatures = result;
58732
- }
58733
- return result;
58734
- }
58735
- function isArrayOrTupleSymbol(symbol) {
58736
- if (!symbol || !globalArrayType.symbol || !globalReadonlyArrayType.symbol) {
58737
- return false;
58738
- }
58739
- return !!getSymbolIfSameReference(symbol, globalArrayType.symbol) || !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
58740
- }
58741
- function isReadonlyArraySymbol(symbol) {
58742
- if (!symbol || !globalReadonlyArrayType.symbol) {
58743
- return false;
58744
- }
58745
- return !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
58713
+ return getSignaturesOfStructuredType(getReducedApparentType(type), kind);
58746
58714
  }
58747
58715
  function findIndexInfo(indexInfos, keyType) {
58748
58716
  return find(indexInfos, (info) => info.keyType === keyType);
@@ -68098,11 +68066,13 @@ function createTypeChecker(host) {
68098
68066
  }
68099
68067
  }
68100
68068
  function inferFromSignature(source, target) {
68101
- const saveBivariant = bivariant;
68102
- const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
68103
- bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
68104
- applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
68105
- bivariant = saveBivariant;
68069
+ if (!(source.flags & 64 /* IsNonInferrable */)) {
68070
+ const saveBivariant = bivariant;
68071
+ const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
68072
+ bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
68073
+ applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
68074
+ bivariant = saveBivariant;
68075
+ }
68106
68076
  applyToReturnTypes(source, target, inferFromTypes);
68107
68077
  }
68108
68078
  function inferFromIndexTypes(source, target) {
@@ -77002,7 +76972,7 @@ function createTypeChecker(host) {
77002
76972
  /*resolvedTypePredicate*/
77003
76973
  void 0,
77004
76974
  0,
77005
- 0 /* None */
76975
+ 64 /* IsNonInferrable */
77006
76976
  );
77007
76977
  const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
77008
76978
  returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
@@ -127759,7 +127729,8 @@ function getDefaultFormatCodeSettings(newLineCharacter) {
127759
127729
  placeOpenBraceOnNewLineForFunctions: false,
127760
127730
  placeOpenBraceOnNewLineForControlBlocks: false,
127761
127731
  semicolons: "ignore" /* Ignore */,
127762
- trimTrailingWhitespace: true
127732
+ trimTrailingWhitespace: true,
127733
+ indentSwitchCase: true
127763
127734
  };
127764
127735
  }
127765
127736
  var testFormatSettings = getDefaultFormatCodeSettings("\n");
@@ -168627,6 +168598,7 @@ var SmartIndenter;
168627
168598
  }
168628
168599
  SmartIndenter2.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn;
168629
168600
  function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) {
168601
+ var _a2;
168630
168602
  const childKind = child ? child.kind : 0 /* Unknown */;
168631
168603
  switch (parent2.kind) {
168632
168604
  case 243 /* ExpressionStatement */:
@@ -168642,9 +168614,6 @@ var SmartIndenter;
168642
168614
  case 186 /* TypeLiteral */:
168643
168615
  case 199 /* MappedType */:
168644
168616
  case 188 /* TupleType */:
168645
- case 268 /* CaseBlock */:
168646
- case 295 /* DefaultClause */:
168647
- case 294 /* CaseClause */:
168648
168617
  case 216 /* ParenthesizedExpression */:
168649
168618
  case 210 /* PropertyAccessExpression */:
168650
168619
  case 212 /* CallExpression */:
@@ -168673,7 +168642,11 @@ var SmartIndenter;
168673
168642
  case 280 /* ExportSpecifier */:
168674
168643
  case 275 /* ImportSpecifier */:
168675
168644
  case 171 /* PropertyDeclaration */:
168645
+ case 294 /* CaseClause */:
168646
+ case 295 /* DefaultClause */:
168676
168647
  return true;
168648
+ case 268 /* CaseBlock */:
168649
+ return (_a2 = settings.indentSwitchCase) != null ? _a2 : true;
168677
168650
  case 259 /* VariableDeclaration */:
168678
168651
  case 301 /* PropertyAssignment */:
168679
168652
  case 225 /* BinaryExpression */:
@@ -2718,6 +2718,7 @@ declare namespace ts {
2718
2718
  placeOpenBraceOnNewLineForControlBlocks?: boolean;
2719
2719
  insertSpaceBeforeTypeAnnotation?: boolean;
2720
2720
  semicolons?: SemicolonPreference;
2721
+ indentSwitchCase?: boolean;
2721
2722
  }
2722
2723
  interface UserPreferences {
2723
2724
  readonly disableSuggestions?: boolean;
@@ -10524,6 +10525,7 @@ declare namespace ts {
10524
10525
  readonly insertSpaceBeforeTypeAnnotation?: boolean;
10525
10526
  readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
10526
10527
  readonly semicolons?: SemicolonPreference;
10528
+ readonly indentSwitchCase?: boolean;
10527
10529
  }
10528
10530
  interface DefinitionInfo extends DocumentSpan {
10529
10531
  kind: ScriptElementKind;
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.1";
38
- version = `${versionMajorMinor}.0-insiders.20230412`;
38
+ version = `${versionMajorMinor}.0-insiders.20230413`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -4566,6 +4566,7 @@ ${lanes.join("\n")}
4566
4566
  SignatureFlags5[SignatureFlags5["IsInnerCallChain"] = 8] = "IsInnerCallChain";
4567
4567
  SignatureFlags5[SignatureFlags5["IsOuterCallChain"] = 16] = "IsOuterCallChain";
4568
4568
  SignatureFlags5[SignatureFlags5["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
4569
+ SignatureFlags5[SignatureFlags5["IsNonInferrable"] = 64] = "IsNonInferrable";
4569
4570
  SignatureFlags5[SignatureFlags5["PropagatingFlags"] = 39] = "PropagatingFlags";
4570
4571
  SignatureFlags5[SignatureFlags5["CallChainFlags"] = 24] = "CallChainFlags";
4571
4572
  return SignatureFlags5;
@@ -47200,11 +47201,6 @@ ${lanes.join("\n")}
47200
47201
  diagnosticMessage = error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
47201
47202
  } else if (result.flags & 256 /* RegularEnum */) {
47202
47203
  diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
47203
- } else {
47204
- Debug.assert(!!(result.flags & 128 /* ConstEnum */));
47205
- if (shouldPreserveConstEnums(compilerOptions)) {
47206
- diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
47207
- }
47208
47204
  }
47209
47205
  if (diagnosticMessage) {
47210
47206
  addRelatedInfo(
@@ -56515,35 +56511,7 @@ ${lanes.join("\n")}
56515
56511
  return emptyArray;
56516
56512
  }
56517
56513
  function getSignaturesOfType(type, kind) {
56518
- const result = getSignaturesOfStructuredType(getReducedApparentType(type), kind);
56519
- if (kind === 0 /* Call */ && !length(result) && type.flags & 1048576 /* Union */) {
56520
- if (type.arrayFallbackSignatures) {
56521
- return type.arrayFallbackSignatures;
56522
- }
56523
- let memberName;
56524
- if (everyType(type, (t) => {
56525
- var _a2;
56526
- return !!((_a2 = t.symbol) == null ? void 0 : _a2.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
56527
- })) {
56528
- const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
56529
- const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
56530
- return type.arrayFallbackSignatures = getSignaturesOfType(getTypeOfPropertyOfType(arrayType, memberName), kind);
56531
- }
56532
- type.arrayFallbackSignatures = result;
56533
- }
56534
- return result;
56535
- }
56536
- function isArrayOrTupleSymbol(symbol) {
56537
- if (!symbol || !globalArrayType.symbol || !globalReadonlyArrayType.symbol) {
56538
- return false;
56539
- }
56540
- return !!getSymbolIfSameReference(symbol, globalArrayType.symbol) || !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
56541
- }
56542
- function isReadonlyArraySymbol(symbol) {
56543
- if (!symbol || !globalReadonlyArrayType.symbol) {
56544
- return false;
56545
- }
56546
- return !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
56514
+ return getSignaturesOfStructuredType(getReducedApparentType(type), kind);
56547
56515
  }
56548
56516
  function findIndexInfo(indexInfos, keyType) {
56549
56517
  return find(indexInfos, (info) => info.keyType === keyType);
@@ -65899,11 +65867,13 @@ ${lanes.join("\n")}
65899
65867
  }
65900
65868
  }
65901
65869
  function inferFromSignature(source, target) {
65902
- const saveBivariant = bivariant;
65903
- const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
65904
- bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
65905
- applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
65906
- bivariant = saveBivariant;
65870
+ if (!(source.flags & 64 /* IsNonInferrable */)) {
65871
+ const saveBivariant = bivariant;
65872
+ const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
65873
+ bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
65874
+ applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
65875
+ bivariant = saveBivariant;
65876
+ }
65907
65877
  applyToReturnTypes(source, target, inferFromTypes);
65908
65878
  }
65909
65879
  function inferFromIndexTypes(source, target) {
@@ -74803,7 +74773,7 @@ ${lanes.join("\n")}
74803
74773
  /*resolvedTypePredicate*/
74804
74774
  void 0,
74805
74775
  0,
74806
- 0 /* None */
74776
+ 64 /* IsNonInferrable */
74807
74777
  );
74808
74778
  const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
74809
74779
  returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
@@ -125996,7 +125966,8 @@ ${lanes.join("\n")}
125996
125966
  placeOpenBraceOnNewLineForFunctions: false,
125997
125967
  placeOpenBraceOnNewLineForControlBlocks: false,
125998
125968
  semicolons: "ignore" /* Ignore */,
125999
- trimTrailingWhitespace: true
125969
+ trimTrailingWhitespace: true,
125970
+ indentSwitchCase: true
126000
125971
  };
126001
125972
  }
126002
125973
  var ScriptSnapshot, PackageJsonDependencyGroup, PackageJsonAutoImportPreference, LanguageServiceMode, emptyOptions, SemanticClassificationFormat, OrganizeImportsMode, CompletionTriggerKind, InlayHintKind, HighlightSpanKind, IndentStyle, SemicolonPreference, testFormatSettings, SymbolDisplayPartKind, CompletionInfoFlags, OutliningSpanKind, OutputFileType, EndOfLineState, TokenClass, ScriptElementKind, ScriptElementKindModifier, ClassificationTypeNames, ClassificationType;
@@ -168121,6 +168092,7 @@ ${options.prefix}` : "\n" : options.prefix
168121
168092
  }
168122
168093
  SmartIndenter2.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn;
168123
168094
  function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) {
168095
+ var _a2;
168124
168096
  const childKind = child ? child.kind : 0 /* Unknown */;
168125
168097
  switch (parent2.kind) {
168126
168098
  case 243 /* ExpressionStatement */:
@@ -168136,9 +168108,6 @@ ${options.prefix}` : "\n" : options.prefix
168136
168108
  case 186 /* TypeLiteral */:
168137
168109
  case 199 /* MappedType */:
168138
168110
  case 188 /* TupleType */:
168139
- case 268 /* CaseBlock */:
168140
- case 295 /* DefaultClause */:
168141
- case 294 /* CaseClause */:
168142
168111
  case 216 /* ParenthesizedExpression */:
168143
168112
  case 210 /* PropertyAccessExpression */:
168144
168113
  case 212 /* CallExpression */:
@@ -168167,7 +168136,11 @@ ${options.prefix}` : "\n" : options.prefix
168167
168136
  case 280 /* ExportSpecifier */:
168168
168137
  case 275 /* ImportSpecifier */:
168169
168138
  case 171 /* PropertyDeclaration */:
168139
+ case 294 /* CaseClause */:
168140
+ case 295 /* DefaultClause */:
168170
168141
  return true;
168142
+ case 268 /* CaseBlock */:
168143
+ return (_a2 = settings.indentSwitchCase) != null ? _a2 : true;
168171
168144
  case 259 /* VariableDeclaration */:
168172
168145
  case 301 /* PropertyAssignment */:
168173
168146
  case 225 /* BinaryExpression */:
@@ -6594,6 +6594,7 @@ declare namespace ts {
6594
6594
  readonly insertSpaceBeforeTypeAnnotation?: boolean;
6595
6595
  readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
6596
6596
  readonly semicolons?: SemicolonPreference;
6597
+ readonly indentSwitchCase?: boolean;
6597
6598
  }
6598
6599
  interface DefinitionInfo extends DocumentSpan {
6599
6600
  kind: ScriptElementKind;
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.1";
38
- version = `${versionMajorMinor}.0-insiders.20230412`;
38
+ version = `${versionMajorMinor}.0-insiders.20230413`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -4566,6 +4566,7 @@ ${lanes.join("\n")}
4566
4566
  SignatureFlags5[SignatureFlags5["IsInnerCallChain"] = 8] = "IsInnerCallChain";
4567
4567
  SignatureFlags5[SignatureFlags5["IsOuterCallChain"] = 16] = "IsOuterCallChain";
4568
4568
  SignatureFlags5[SignatureFlags5["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
4569
+ SignatureFlags5[SignatureFlags5["IsNonInferrable"] = 64] = "IsNonInferrable";
4569
4570
  SignatureFlags5[SignatureFlags5["PropagatingFlags"] = 39] = "PropagatingFlags";
4570
4571
  SignatureFlags5[SignatureFlags5["CallChainFlags"] = 24] = "CallChainFlags";
4571
4572
  return SignatureFlags5;
@@ -47200,11 +47201,6 @@ ${lanes.join("\n")}
47200
47201
  diagnosticMessage = error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
47201
47202
  } else if (result.flags & 256 /* RegularEnum */) {
47202
47203
  diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
47203
- } else {
47204
- Debug.assert(!!(result.flags & 128 /* ConstEnum */));
47205
- if (shouldPreserveConstEnums(compilerOptions)) {
47206
- diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
47207
- }
47208
47204
  }
47209
47205
  if (diagnosticMessage) {
47210
47206
  addRelatedInfo(
@@ -56515,35 +56511,7 @@ ${lanes.join("\n")}
56515
56511
  return emptyArray;
56516
56512
  }
56517
56513
  function getSignaturesOfType(type, kind) {
56518
- const result = getSignaturesOfStructuredType(getReducedApparentType(type), kind);
56519
- if (kind === 0 /* Call */ && !length(result) && type.flags & 1048576 /* Union */) {
56520
- if (type.arrayFallbackSignatures) {
56521
- return type.arrayFallbackSignatures;
56522
- }
56523
- let memberName;
56524
- if (everyType(type, (t) => {
56525
- var _a2;
56526
- return !!((_a2 = t.symbol) == null ? void 0 : _a2.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
56527
- })) {
56528
- const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
56529
- const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
56530
- return type.arrayFallbackSignatures = getSignaturesOfType(getTypeOfPropertyOfType(arrayType, memberName), kind);
56531
- }
56532
- type.arrayFallbackSignatures = result;
56533
- }
56534
- return result;
56535
- }
56536
- function isArrayOrTupleSymbol(symbol) {
56537
- if (!symbol || !globalArrayType.symbol || !globalReadonlyArrayType.symbol) {
56538
- return false;
56539
- }
56540
- return !!getSymbolIfSameReference(symbol, globalArrayType.symbol) || !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
56541
- }
56542
- function isReadonlyArraySymbol(symbol) {
56543
- if (!symbol || !globalReadonlyArrayType.symbol) {
56544
- return false;
56545
- }
56546
- return !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
56514
+ return getSignaturesOfStructuredType(getReducedApparentType(type), kind);
56547
56515
  }
56548
56516
  function findIndexInfo(indexInfos, keyType) {
56549
56517
  return find(indexInfos, (info) => info.keyType === keyType);
@@ -65899,11 +65867,13 @@ ${lanes.join("\n")}
65899
65867
  }
65900
65868
  }
65901
65869
  function inferFromSignature(source, target) {
65902
- const saveBivariant = bivariant;
65903
- const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
65904
- bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
65905
- applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
65906
- bivariant = saveBivariant;
65870
+ if (!(source.flags & 64 /* IsNonInferrable */)) {
65871
+ const saveBivariant = bivariant;
65872
+ const kind = target.declaration ? target.declaration.kind : 0 /* Unknown */;
65873
+ bivariant = bivariant || kind === 173 /* MethodDeclaration */ || kind === 172 /* MethodSignature */ || kind === 175 /* Constructor */;
65874
+ applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes);
65875
+ bivariant = saveBivariant;
65876
+ }
65907
65877
  applyToReturnTypes(source, target, inferFromTypes);
65908
65878
  }
65909
65879
  function inferFromIndexTypes(source, target) {
@@ -74803,7 +74773,7 @@ ${lanes.join("\n")}
74803
74773
  /*resolvedTypePredicate*/
74804
74774
  void 0,
74805
74775
  0,
74806
- 0 /* None */
74776
+ 64 /* IsNonInferrable */
74807
74777
  );
74808
74778
  const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
74809
74779
  returnOnlyType.objectFlags |= 262144 /* NonInferrableType */;
@@ -126010,7 +125980,8 @@ ${lanes.join("\n")}
126010
125980
  placeOpenBraceOnNewLineForFunctions: false,
126011
125981
  placeOpenBraceOnNewLineForControlBlocks: false,
126012
125982
  semicolons: "ignore" /* Ignore */,
126013
- trimTrailingWhitespace: true
125983
+ trimTrailingWhitespace: true,
125984
+ indentSwitchCase: true
126014
125985
  };
126015
125986
  }
126016
125987
  var ScriptSnapshot, PackageJsonDependencyGroup, PackageJsonAutoImportPreference, LanguageServiceMode, emptyOptions, SemanticClassificationFormat, OrganizeImportsMode, CompletionTriggerKind, InlayHintKind, HighlightSpanKind, IndentStyle, SemicolonPreference, testFormatSettings, SymbolDisplayPartKind, CompletionInfoFlags, OutliningSpanKind, OutputFileType, EndOfLineState, TokenClass, ScriptElementKind, ScriptElementKindModifier, ClassificationTypeNames, ClassificationType;
@@ -168135,6 +168106,7 @@ ${options.prefix}` : "\n" : options.prefix
168135
168106
  }
168136
168107
  SmartIndenter2.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn;
168137
168108
  function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) {
168109
+ var _a2;
168138
168110
  const childKind = child ? child.kind : 0 /* Unknown */;
168139
168111
  switch (parent2.kind) {
168140
168112
  case 243 /* ExpressionStatement */:
@@ -168150,9 +168122,6 @@ ${options.prefix}` : "\n" : options.prefix
168150
168122
  case 186 /* TypeLiteral */:
168151
168123
  case 199 /* MappedType */:
168152
168124
  case 188 /* TupleType */:
168153
- case 268 /* CaseBlock */:
168154
- case 295 /* DefaultClause */:
168155
- case 294 /* CaseClause */:
168156
168125
  case 216 /* ParenthesizedExpression */:
168157
168126
  case 210 /* PropertyAccessExpression */:
168158
168127
  case 212 /* CallExpression */:
@@ -168181,7 +168150,11 @@ ${options.prefix}` : "\n" : options.prefix
168181
168150
  case 280 /* ExportSpecifier */:
168182
168151
  case 275 /* ImportSpecifier */:
168183
168152
  case 171 /* PropertyDeclaration */:
168153
+ case 294 /* CaseClause */:
168154
+ case 295 /* DefaultClause */:
168184
168155
  return true;
168156
+ case 268 /* CaseBlock */:
168157
+ return (_a2 = settings.indentSwitchCase) != null ? _a2 : true;
168185
168158
  case 259 /* VariableDeclaration */:
168186
168159
  case 301 /* PropertyAssignment */:
168187
168160
  case 225 /* BinaryExpression */:
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.1";
57
- var version = `${versionMajorMinor}.0-insiders.20230412`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230413`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -3183,6 +3183,7 @@ var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => {
3183
3183
  SignatureFlags4[SignatureFlags4["IsInnerCallChain"] = 8] = "IsInnerCallChain";
3184
3184
  SignatureFlags4[SignatureFlags4["IsOuterCallChain"] = 16] = "IsOuterCallChain";
3185
3185
  SignatureFlags4[SignatureFlags4["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
3186
+ SignatureFlags4[SignatureFlags4["IsNonInferrable"] = 64] = "IsNonInferrable";
3186
3187
  SignatureFlags4[SignatureFlags4["PropagatingFlags"] = 39] = "PropagatingFlags";
3187
3188
  SignatureFlags4[SignatureFlags4["CallChainFlags"] = 24] = "CallChainFlags";
3188
3189
  return SignatureFlags4;
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.1.0-pr-53489-15",
5
+ "version": "5.1.0-pr-53756-16",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "14.21.1",
115
115
  "npm": "8.19.3"
116
116
  },
117
- "gitHead": "c8bb06f875118d1186d88f0ba8a98d03de76defe"
117
+ "gitHead": "e1e71a8563ff75c6d75591c34985f7e18ad1610f"
118
118
  }