@typescript-deploys/pr-build 5.2.0-pr-52493-8 → 5.2.0-pr-53647-17

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
@@ -13287,8 +13287,8 @@ function isInExpressionContext(node) {
13287
13287
  return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
13288
13288
  case 249 /* ForInStatement */:
13289
13289
  case 250 /* ForOfStatement */:
13290
- const forInOrOfStatement = parent;
13291
- return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node;
13290
+ const forInStatement = parent;
13291
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInStatement.expression === node;
13292
13292
  case 216 /* TypeAssertionExpression */:
13293
13293
  case 234 /* AsExpression */:
13294
13294
  return node === parent.expression;
@@ -13949,23 +13949,20 @@ function getTypeParameterFromJsDoc(node) {
13949
13949
  const { typeParameters } = node.parent.parent.parent;
13950
13950
  return typeParameters && find(typeParameters, (p) => p.name.escapedText === name);
13951
13951
  }
13952
- function getAssignmentTarget(node) {
13952
+ function getAssignmentTargetKind(node) {
13953
13953
  let parent = node.parent;
13954
13954
  while (true) {
13955
13955
  switch (parent.kind) {
13956
13956
  case 226 /* BinaryExpression */:
13957
- const binaryExpression = parent;
13958
- const binaryOperator = binaryExpression.operatorToken.kind;
13959
- return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0;
13957
+ const binaryOperator = parent.operatorToken.kind;
13958
+ return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
13960
13959
  case 224 /* PrefixUnaryExpression */:
13961
13960
  case 225 /* PostfixUnaryExpression */:
13962
- const unaryExpression = parent;
13963
- const unaryOperator = unaryExpression.operator;
13964
- return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0;
13961
+ const unaryOperator = parent.operator;
13962
+ return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
13965
13963
  case 249 /* ForInStatement */:
13966
13964
  case 250 /* ForOfStatement */:
13967
- const forInOrOfStatement = parent;
13968
- return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0;
13965
+ return parent.initializer === node ? 1 /* Definite */ : 0 /* None */;
13969
13966
  case 217 /* ParenthesizedExpression */:
13970
13967
  case 209 /* ArrayLiteralExpression */:
13971
13968
  case 230 /* SpreadElement */:
@@ -13977,53 +13974,24 @@ function getAssignmentTarget(node) {
13977
13974
  break;
13978
13975
  case 304 /* ShorthandPropertyAssignment */:
13979
13976
  if (parent.name !== node) {
13980
- return void 0;
13977
+ return 0 /* None */;
13981
13978
  }
13982
13979
  node = parent.parent;
13983
13980
  break;
13984
13981
  case 303 /* PropertyAssignment */:
13985
13982
  if (parent.name === node) {
13986
- return void 0;
13983
+ return 0 /* None */;
13987
13984
  }
13988
13985
  node = parent.parent;
13989
13986
  break;
13990
13987
  default:
13991
- return void 0;
13988
+ return 0 /* None */;
13992
13989
  }
13993
13990
  parent = node.parent;
13994
13991
  }
13995
13992
  }
13996
- function getAssignmentTargetKind(node) {
13997
- const target = getAssignmentTarget(node);
13998
- if (!target) {
13999
- return 0 /* None */;
14000
- }
14001
- switch (target.kind) {
14002
- case 226 /* BinaryExpression */:
14003
- const binaryOperator = target.operatorToken.kind;
14004
- return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */;
14005
- case 224 /* PrefixUnaryExpression */:
14006
- case 225 /* PostfixUnaryExpression */:
14007
- return 2 /* Compound */;
14008
- case 249 /* ForInStatement */:
14009
- case 250 /* ForOfStatement */:
14010
- return 1 /* Definite */;
14011
- }
14012
- }
14013
13993
  function isAssignmentTarget(node) {
14014
- return !!getAssignmentTarget(node);
14015
- }
14016
- function isCompoundLikeAssignment(assignment) {
14017
- const right = skipParentheses(assignment.right);
14018
- return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind);
14019
- }
14020
- function isInCompoundLikeAssignment(node) {
14021
- const target = getAssignmentTarget(node);
14022
- return !!target && isAssignmentExpression(
14023
- target,
14024
- /*excludeCompoundAssignment*/
14025
- true
14026
- ) && isCompoundLikeAssignment(target);
13994
+ return getAssignmentTargetKind(node) !== 0 /* None */;
14027
13995
  }
14028
13996
  function isNodeWithPossibleHoistedDeclaration(node) {
14029
13997
  switch (node.kind) {
@@ -43778,7 +43746,7 @@ function createTypeChecker(host) {
43778
43746
  };
43779
43747
  var amalgamatedDuplicates;
43780
43748
  var reverseMappedCache = /* @__PURE__ */ new Map();
43781
- var inInferTypeForHomomorphicMappedType = false;
43749
+ var homomorphicMappedTypeInferenceStack = [];
43782
43750
  var ambientModulesCache;
43783
43751
  var patternAmbientModules;
43784
43752
  var patternAmbientModuleAugmentations;
@@ -62132,7 +62100,7 @@ function createTypeChecker(host) {
62132
62100
  }
62133
62101
  }
62134
62102
  }
62135
- const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i])) : target;
62103
+ const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i]), 0 /* None */) : target;
62136
62104
  return filtered.flags & 131072 /* Never */ ? target : filtered;
62137
62105
  }
62138
62106
  function isWeakType(type) {
@@ -63166,17 +63134,18 @@ function createTypeChecker(host) {
63166
63134
  );
63167
63135
  }
63168
63136
  function inferTypeForHomomorphicMappedType(source, target, constraint) {
63169
- if (inInferTypeForHomomorphicMappedType) {
63170
- return void 0;
63137
+ const cacheKey = source.id + "," + target.id + "," + constraint.id;
63138
+ if (reverseMappedCache.has(cacheKey)) {
63139
+ return reverseMappedCache.get(cacheKey);
63171
63140
  }
63172
- const key = source.id + "," + target.id + "," + constraint.id;
63173
- if (reverseMappedCache.has(key)) {
63174
- return reverseMappedCache.get(key);
63141
+ const recursionKey = source.id + "," + (target.target || target).id;
63142
+ if (contains(homomorphicMappedTypeInferenceStack, recursionKey)) {
63143
+ return void 0;
63175
63144
  }
63176
- inInferTypeForHomomorphicMappedType = true;
63145
+ homomorphicMappedTypeInferenceStack.push(recursionKey);
63177
63146
  const type = createReverseMappedType(source, target, constraint);
63178
- inInferTypeForHomomorphicMappedType = false;
63179
- reverseMappedCache.set(key, type);
63147
+ homomorphicMappedTypeInferenceStack.pop();
63148
+ reverseMappedCache.set(cacheKey, type);
63180
63149
  return type;
63181
63150
  }
63182
63151
  function isPartiallyInferableType(type) {
@@ -65203,11 +65172,10 @@ function createTypeChecker(host) {
65203
65172
  const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow));
65204
65173
  return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
65205
65174
  }
65206
- const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType;
65207
- if (t.flags & 1048576 /* Union */) {
65208
- return getAssignmentReducedType(t, getInitialOrAssignedType(flow));
65175
+ if (declaredType.flags & 1048576 /* Union */) {
65176
+ return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow));
65209
65177
  }
65210
- return t;
65178
+ return declaredType;
65211
65179
  }
65212
65180
  if (containsMatchingReference(reference, node)) {
65213
65181
  if (!isReachableFlowNode(flow)) {
@@ -66336,7 +66304,7 @@ function createTypeChecker(host) {
66336
66304
  const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */;
66337
66305
  if (localOrExportSymbol.flags & 3 /* Variable */) {
66338
66306
  if (assignmentKind === 1 /* Definite */) {
66339
- return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type;
66307
+ return type;
66340
66308
  }
66341
66309
  } else if (isAlias) {
66342
66310
  declaration = getDeclarationOfAliasSymbol(symbol);
package/lib/tsserver.js CHANGED
@@ -1414,7 +1414,6 @@ __export(server_exports, {
1414
1414
  isImportTypeNode: () => isImportTypeNode,
1415
1415
  isImportableFile: () => isImportableFile,
1416
1416
  isInComment: () => isInComment,
1417
- isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
1418
1417
  isInExpressionContext: () => isInExpressionContext,
1419
1418
  isInJSDoc: () => isInJSDoc,
1420
1419
  isInJSFile: () => isInJSFile,
@@ -1707,7 +1706,6 @@ __export(server_exports, {
1707
1706
  isSetAccessor: () => isSetAccessor,
1708
1707
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
1709
1708
  isShebangTrivia: () => isShebangTrivia,
1710
- isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
1711
1709
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
1712
1710
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
1713
1711
  isSignedNumericLiteral: () => isSignedNumericLiteral,
@@ -17127,8 +17125,8 @@ function isInExpressionContext(node) {
17127
17125
  return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
17128
17126
  case 249 /* ForInStatement */:
17129
17127
  case 250 /* ForOfStatement */:
17130
- const forInOrOfStatement = parent2;
17131
- return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node;
17128
+ const forInStatement = parent2;
17129
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInStatement.expression === node;
17132
17130
  case 216 /* TypeAssertionExpression */:
17133
17131
  case 234 /* AsExpression */:
17134
17132
  return node === parent2.expression;
@@ -17824,23 +17822,20 @@ var AssignmentKind = /* @__PURE__ */ ((AssignmentKind2) => {
17824
17822
  AssignmentKind2[AssignmentKind2["Compound"] = 2] = "Compound";
17825
17823
  return AssignmentKind2;
17826
17824
  })(AssignmentKind || {});
17827
- function getAssignmentTarget(node) {
17825
+ function getAssignmentTargetKind(node) {
17828
17826
  let parent2 = node.parent;
17829
17827
  while (true) {
17830
17828
  switch (parent2.kind) {
17831
17829
  case 226 /* BinaryExpression */:
17832
- const binaryExpression = parent2;
17833
- const binaryOperator = binaryExpression.operatorToken.kind;
17834
- return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0;
17830
+ const binaryOperator = parent2.operatorToken.kind;
17831
+ return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
17835
17832
  case 224 /* PrefixUnaryExpression */:
17836
17833
  case 225 /* PostfixUnaryExpression */:
17837
- const unaryExpression = parent2;
17838
- const unaryOperator = unaryExpression.operator;
17839
- return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0;
17834
+ const unaryOperator = parent2.operator;
17835
+ return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
17840
17836
  case 249 /* ForInStatement */:
17841
17837
  case 250 /* ForOfStatement */:
17842
- const forInOrOfStatement = parent2;
17843
- return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0;
17838
+ return parent2.initializer === node ? 1 /* Definite */ : 0 /* None */;
17844
17839
  case 217 /* ParenthesizedExpression */:
17845
17840
  case 209 /* ArrayLiteralExpression */:
17846
17841
  case 230 /* SpreadElement */:
@@ -17852,53 +17847,24 @@ function getAssignmentTarget(node) {
17852
17847
  break;
17853
17848
  case 304 /* ShorthandPropertyAssignment */:
17854
17849
  if (parent2.name !== node) {
17855
- return void 0;
17850
+ return 0 /* None */;
17856
17851
  }
17857
17852
  node = parent2.parent;
17858
17853
  break;
17859
17854
  case 303 /* PropertyAssignment */:
17860
17855
  if (parent2.name === node) {
17861
- return void 0;
17856
+ return 0 /* None */;
17862
17857
  }
17863
17858
  node = parent2.parent;
17864
17859
  break;
17865
17860
  default:
17866
- return void 0;
17861
+ return 0 /* None */;
17867
17862
  }
17868
17863
  parent2 = node.parent;
17869
17864
  }
17870
17865
  }
17871
- function getAssignmentTargetKind(node) {
17872
- const target = getAssignmentTarget(node);
17873
- if (!target) {
17874
- return 0 /* None */;
17875
- }
17876
- switch (target.kind) {
17877
- case 226 /* BinaryExpression */:
17878
- const binaryOperator = target.operatorToken.kind;
17879
- return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */;
17880
- case 224 /* PrefixUnaryExpression */:
17881
- case 225 /* PostfixUnaryExpression */:
17882
- return 2 /* Compound */;
17883
- case 249 /* ForInStatement */:
17884
- case 250 /* ForOfStatement */:
17885
- return 1 /* Definite */;
17886
- }
17887
- }
17888
17866
  function isAssignmentTarget(node) {
17889
- return !!getAssignmentTarget(node);
17890
- }
17891
- function isCompoundLikeAssignment(assignment) {
17892
- const right = skipParentheses(assignment.right);
17893
- return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind);
17894
- }
17895
- function isInCompoundLikeAssignment(node) {
17896
- const target = getAssignmentTarget(node);
17897
- return !!target && isAssignmentExpression(
17898
- target,
17899
- /*excludeCompoundAssignment*/
17900
- true
17901
- ) && isCompoundLikeAssignment(target);
17867
+ return getAssignmentTargetKind(node) !== 0 /* None */;
17902
17868
  }
17903
17869
  function isNodeWithPossibleHoistedDeclaration(node) {
17904
17870
  switch (node.kind) {
@@ -48456,7 +48422,7 @@ function createTypeChecker(host) {
48456
48422
  };
48457
48423
  var amalgamatedDuplicates;
48458
48424
  var reverseMappedCache = /* @__PURE__ */ new Map();
48459
- var inInferTypeForHomomorphicMappedType = false;
48425
+ var homomorphicMappedTypeInferenceStack = [];
48460
48426
  var ambientModulesCache;
48461
48427
  var patternAmbientModules;
48462
48428
  var patternAmbientModuleAugmentations;
@@ -66810,7 +66776,7 @@ function createTypeChecker(host) {
66810
66776
  }
66811
66777
  }
66812
66778
  }
66813
- const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i])) : target;
66779
+ const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i]), 0 /* None */) : target;
66814
66780
  return filtered.flags & 131072 /* Never */ ? target : filtered;
66815
66781
  }
66816
66782
  function isWeakType(type) {
@@ -67844,17 +67810,18 @@ function createTypeChecker(host) {
67844
67810
  );
67845
67811
  }
67846
67812
  function inferTypeForHomomorphicMappedType(source, target, constraint) {
67847
- if (inInferTypeForHomomorphicMappedType) {
67848
- return void 0;
67813
+ const cacheKey = source.id + "," + target.id + "," + constraint.id;
67814
+ if (reverseMappedCache.has(cacheKey)) {
67815
+ return reverseMappedCache.get(cacheKey);
67849
67816
  }
67850
- const key = source.id + "," + target.id + "," + constraint.id;
67851
- if (reverseMappedCache.has(key)) {
67852
- return reverseMappedCache.get(key);
67817
+ const recursionKey = source.id + "," + (target.target || target).id;
67818
+ if (contains(homomorphicMappedTypeInferenceStack, recursionKey)) {
67819
+ return void 0;
67853
67820
  }
67854
- inInferTypeForHomomorphicMappedType = true;
67821
+ homomorphicMappedTypeInferenceStack.push(recursionKey);
67855
67822
  const type = createReverseMappedType(source, target, constraint);
67856
- inInferTypeForHomomorphicMappedType = false;
67857
- reverseMappedCache.set(key, type);
67823
+ homomorphicMappedTypeInferenceStack.pop();
67824
+ reverseMappedCache.set(cacheKey, type);
67858
67825
  return type;
67859
67826
  }
67860
67827
  function isPartiallyInferableType(type) {
@@ -69881,11 +69848,10 @@ function createTypeChecker(host) {
69881
69848
  const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow));
69882
69849
  return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
69883
69850
  }
69884
- const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType;
69885
- if (t.flags & 1048576 /* Union */) {
69886
- return getAssignmentReducedType(t, getInitialOrAssignedType(flow));
69851
+ if (declaredType.flags & 1048576 /* Union */) {
69852
+ return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow));
69887
69853
  }
69888
- return t;
69854
+ return declaredType;
69889
69855
  }
69890
69856
  if (containsMatchingReference(reference, node)) {
69891
69857
  if (!isReachableFlowNode(flow)) {
@@ -71014,7 +70980,7 @@ function createTypeChecker(host) {
71014
70980
  const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */;
71015
70981
  if (localOrExportSymbol.flags & 3 /* Variable */) {
71016
70982
  if (assignmentKind === 1 /* Definite */) {
71017
- return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type;
70983
+ return type;
71018
70984
  }
71019
70985
  } else if (isAlias) {
71020
70986
  declaration = getDeclarationOfAliasSymbol(symbol);
@@ -173025,7 +172991,6 @@ __export(ts_exports2, {
173025
172991
  isImportTypeNode: () => isImportTypeNode,
173026
172992
  isImportableFile: () => isImportableFile,
173027
172993
  isInComment: () => isInComment,
173028
- isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
173029
172994
  isInExpressionContext: () => isInExpressionContext,
173030
172995
  isInJSDoc: () => isInJSDoc,
173031
172996
  isInJSFile: () => isInJSFile,
@@ -173318,7 +173283,6 @@ __export(ts_exports2, {
173318
173283
  isSetAccessor: () => isSetAccessor,
173319
173284
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
173320
173285
  isShebangTrivia: () => isShebangTrivia,
173321
- isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
173322
173286
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
173323
173287
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
173324
173288
  isSignedNumericLiteral: () => isSignedNumericLiteral,
@@ -187540,7 +187504,6 @@ start(initializeNodeSystem(), require("os").platform());
187540
187504
  isImportTypeNode,
187541
187505
  isImportableFile,
187542
187506
  isInComment,
187543
- isInCompoundLikeAssignment,
187544
187507
  isInExpressionContext,
187545
187508
  isInJSDoc,
187546
187509
  isInJSFile,
@@ -187833,7 +187796,6 @@ start(initializeNodeSystem(), require("os").platform());
187833
187796
  isSetAccessor,
187834
187797
  isSetAccessorDeclaration,
187835
187798
  isShebangTrivia,
187836
- isShiftOperatorOrHigher,
187837
187799
  isShorthandAmbientModuleSymbol,
187838
187800
  isShorthandPropertyAssignment,
187839
187801
  isSignedNumericLiteral,
@@ -14905,8 +14905,8 @@ ${lanes.join("\n")}
14905
14905
  return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
14906
14906
  case 249 /* ForInStatement */:
14907
14907
  case 250 /* ForOfStatement */:
14908
- const forInOrOfStatement = parent2;
14909
- return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node;
14908
+ const forInStatement = parent2;
14909
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInStatement.expression === node;
14910
14910
  case 216 /* TypeAssertionExpression */:
14911
14911
  case 234 /* AsExpression */:
14912
14912
  return node === parent2.expression;
@@ -15596,23 +15596,20 @@ ${lanes.join("\n")}
15596
15596
  function hasTypeArguments(node) {
15597
15597
  return !!node.typeArguments;
15598
15598
  }
15599
- function getAssignmentTarget(node) {
15599
+ function getAssignmentTargetKind(node) {
15600
15600
  let parent2 = node.parent;
15601
15601
  while (true) {
15602
15602
  switch (parent2.kind) {
15603
15603
  case 226 /* BinaryExpression */:
15604
- const binaryExpression = parent2;
15605
- const binaryOperator = binaryExpression.operatorToken.kind;
15606
- return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0;
15604
+ const binaryOperator = parent2.operatorToken.kind;
15605
+ return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
15607
15606
  case 224 /* PrefixUnaryExpression */:
15608
15607
  case 225 /* PostfixUnaryExpression */:
15609
- const unaryExpression = parent2;
15610
- const unaryOperator = unaryExpression.operator;
15611
- return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0;
15608
+ const unaryOperator = parent2.operator;
15609
+ return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
15612
15610
  case 249 /* ForInStatement */:
15613
15611
  case 250 /* ForOfStatement */:
15614
- const forInOrOfStatement = parent2;
15615
- return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0;
15612
+ return parent2.initializer === node ? 1 /* Definite */ : 0 /* None */;
15616
15613
  case 217 /* ParenthesizedExpression */:
15617
15614
  case 209 /* ArrayLiteralExpression */:
15618
15615
  case 230 /* SpreadElement */:
@@ -15624,53 +15621,24 @@ ${lanes.join("\n")}
15624
15621
  break;
15625
15622
  case 304 /* ShorthandPropertyAssignment */:
15626
15623
  if (parent2.name !== node) {
15627
- return void 0;
15624
+ return 0 /* None */;
15628
15625
  }
15629
15626
  node = parent2.parent;
15630
15627
  break;
15631
15628
  case 303 /* PropertyAssignment */:
15632
15629
  if (parent2.name === node) {
15633
- return void 0;
15630
+ return 0 /* None */;
15634
15631
  }
15635
15632
  node = parent2.parent;
15636
15633
  break;
15637
15634
  default:
15638
- return void 0;
15635
+ return 0 /* None */;
15639
15636
  }
15640
15637
  parent2 = node.parent;
15641
15638
  }
15642
15639
  }
15643
- function getAssignmentTargetKind(node) {
15644
- const target = getAssignmentTarget(node);
15645
- if (!target) {
15646
- return 0 /* None */;
15647
- }
15648
- switch (target.kind) {
15649
- case 226 /* BinaryExpression */:
15650
- const binaryOperator = target.operatorToken.kind;
15651
- return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */;
15652
- case 224 /* PrefixUnaryExpression */:
15653
- case 225 /* PostfixUnaryExpression */:
15654
- return 2 /* Compound */;
15655
- case 249 /* ForInStatement */:
15656
- case 250 /* ForOfStatement */:
15657
- return 1 /* Definite */;
15658
- }
15659
- }
15660
15640
  function isAssignmentTarget(node) {
15661
- return !!getAssignmentTarget(node);
15662
- }
15663
- function isCompoundLikeAssignment(assignment) {
15664
- const right = skipParentheses(assignment.right);
15665
- return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind);
15666
- }
15667
- function isInCompoundLikeAssignment(node) {
15668
- const target = getAssignmentTarget(node);
15669
- return !!target && isAssignmentExpression(
15670
- target,
15671
- /*excludeCompoundAssignment*/
15672
- true
15673
- ) && isCompoundLikeAssignment(target);
15641
+ return getAssignmentTargetKind(node) !== 0 /* None */;
15674
15642
  }
15675
15643
  function isNodeWithPossibleHoistedDeclaration(node) {
15676
15644
  switch (node.kind) {
@@ -46221,7 +46189,7 @@ ${lanes.join("\n")}
46221
46189
  };
46222
46190
  var amalgamatedDuplicates;
46223
46191
  var reverseMappedCache = /* @__PURE__ */ new Map();
46224
- var inInferTypeForHomomorphicMappedType = false;
46192
+ var homomorphicMappedTypeInferenceStack = [];
46225
46193
  var ambientModulesCache;
46226
46194
  var patternAmbientModules;
46227
46195
  var patternAmbientModuleAugmentations;
@@ -64575,7 +64543,7 @@ ${lanes.join("\n")}
64575
64543
  }
64576
64544
  }
64577
64545
  }
64578
- const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i])) : target;
64546
+ const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i]), 0 /* None */) : target;
64579
64547
  return filtered.flags & 131072 /* Never */ ? target : filtered;
64580
64548
  }
64581
64549
  function isWeakType(type) {
@@ -65609,17 +65577,18 @@ ${lanes.join("\n")}
65609
65577
  );
65610
65578
  }
65611
65579
  function inferTypeForHomomorphicMappedType(source, target, constraint) {
65612
- if (inInferTypeForHomomorphicMappedType) {
65613
- return void 0;
65580
+ const cacheKey = source.id + "," + target.id + "," + constraint.id;
65581
+ if (reverseMappedCache.has(cacheKey)) {
65582
+ return reverseMappedCache.get(cacheKey);
65614
65583
  }
65615
- const key = source.id + "," + target.id + "," + constraint.id;
65616
- if (reverseMappedCache.has(key)) {
65617
- return reverseMappedCache.get(key);
65584
+ const recursionKey = source.id + "," + (target.target || target).id;
65585
+ if (contains(homomorphicMappedTypeInferenceStack, recursionKey)) {
65586
+ return void 0;
65618
65587
  }
65619
- inInferTypeForHomomorphicMappedType = true;
65588
+ homomorphicMappedTypeInferenceStack.push(recursionKey);
65620
65589
  const type = createReverseMappedType(source, target, constraint);
65621
- inInferTypeForHomomorphicMappedType = false;
65622
- reverseMappedCache.set(key, type);
65590
+ homomorphicMappedTypeInferenceStack.pop();
65591
+ reverseMappedCache.set(cacheKey, type);
65623
65592
  return type;
65624
65593
  }
65625
65594
  function isPartiallyInferableType(type) {
@@ -67646,11 +67615,10 @@ ${lanes.join("\n")}
67646
67615
  const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow));
67647
67616
  return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
67648
67617
  }
67649
- const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType;
67650
- if (t.flags & 1048576 /* Union */) {
67651
- return getAssignmentReducedType(t, getInitialOrAssignedType(flow));
67618
+ if (declaredType.flags & 1048576 /* Union */) {
67619
+ return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow));
67652
67620
  }
67653
- return t;
67621
+ return declaredType;
67654
67622
  }
67655
67623
  if (containsMatchingReference(reference, node)) {
67656
67624
  if (!isReachableFlowNode(flow)) {
@@ -68779,7 +68747,7 @@ ${lanes.join("\n")}
68779
68747
  const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */;
68780
68748
  if (localOrExportSymbol.flags & 3 /* Variable */) {
68781
68749
  if (assignmentKind === 1 /* Definite */) {
68782
- return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type;
68750
+ return type;
68783
68751
  }
68784
68752
  } else if (isAlias) {
68785
68753
  declaration = getDeclarationOfAliasSymbol(symbol);
@@ -184163,7 +184131,6 @@ ${e.message}`;
184163
184131
  isImportTypeNode: () => isImportTypeNode,
184164
184132
  isImportableFile: () => isImportableFile,
184165
184133
  isInComment: () => isInComment,
184166
- isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
184167
184134
  isInExpressionContext: () => isInExpressionContext,
184168
184135
  isInJSDoc: () => isInJSDoc,
184169
184136
  isInJSFile: () => isInJSFile,
@@ -184456,7 +184423,6 @@ ${e.message}`;
184456
184423
  isSetAccessor: () => isSetAccessor,
184457
184424
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
184458
184425
  isShebangTrivia: () => isShebangTrivia,
184459
- isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
184460
184426
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
184461
184427
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
184462
184428
  isSignedNumericLiteral: () => isSignedNumericLiteral,
@@ -186568,7 +186534,6 @@ ${e.message}`;
186568
186534
  isImportTypeNode: () => isImportTypeNode,
186569
186535
  isImportableFile: () => isImportableFile,
186570
186536
  isInComment: () => isInComment,
186571
- isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
186572
186537
  isInExpressionContext: () => isInExpressionContext,
186573
186538
  isInJSDoc: () => isInJSDoc,
186574
186539
  isInJSFile: () => isInJSFile,
@@ -186861,7 +186826,6 @@ ${e.message}`;
186861
186826
  isSetAccessor: () => isSetAccessor,
186862
186827
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
186863
186828
  isShebangTrivia: () => isShebangTrivia,
186864
- isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
186865
186829
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
186866
186830
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
186867
186831
  isSignedNumericLiteral: () => isSignedNumericLiteral,
package/lib/typescript.js CHANGED
@@ -14905,8 +14905,8 @@ ${lanes.join("\n")}
14905
14905
  return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
14906
14906
  case 249 /* ForInStatement */:
14907
14907
  case 250 /* ForOfStatement */:
14908
- const forInOrOfStatement = parent2;
14909
- return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node;
14908
+ const forInStatement = parent2;
14909
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInStatement.expression === node;
14910
14910
  case 216 /* TypeAssertionExpression */:
14911
14911
  case 234 /* AsExpression */:
14912
14912
  return node === parent2.expression;
@@ -15596,23 +15596,20 @@ ${lanes.join("\n")}
15596
15596
  function hasTypeArguments(node) {
15597
15597
  return !!node.typeArguments;
15598
15598
  }
15599
- function getAssignmentTarget(node) {
15599
+ function getAssignmentTargetKind(node) {
15600
15600
  let parent2 = node.parent;
15601
15601
  while (true) {
15602
15602
  switch (parent2.kind) {
15603
15603
  case 226 /* BinaryExpression */:
15604
- const binaryExpression = parent2;
15605
- const binaryOperator = binaryExpression.operatorToken.kind;
15606
- return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0;
15604
+ const binaryOperator = parent2.operatorToken.kind;
15605
+ return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
15607
15606
  case 224 /* PrefixUnaryExpression */:
15608
15607
  case 225 /* PostfixUnaryExpression */:
15609
- const unaryExpression = parent2;
15610
- const unaryOperator = unaryExpression.operator;
15611
- return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0;
15608
+ const unaryOperator = parent2.operator;
15609
+ return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
15612
15610
  case 249 /* ForInStatement */:
15613
15611
  case 250 /* ForOfStatement */:
15614
- const forInOrOfStatement = parent2;
15615
- return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0;
15612
+ return parent2.initializer === node ? 1 /* Definite */ : 0 /* None */;
15616
15613
  case 217 /* ParenthesizedExpression */:
15617
15614
  case 209 /* ArrayLiteralExpression */:
15618
15615
  case 230 /* SpreadElement */:
@@ -15624,53 +15621,24 @@ ${lanes.join("\n")}
15624
15621
  break;
15625
15622
  case 304 /* ShorthandPropertyAssignment */:
15626
15623
  if (parent2.name !== node) {
15627
- return void 0;
15624
+ return 0 /* None */;
15628
15625
  }
15629
15626
  node = parent2.parent;
15630
15627
  break;
15631
15628
  case 303 /* PropertyAssignment */:
15632
15629
  if (parent2.name === node) {
15633
- return void 0;
15630
+ return 0 /* None */;
15634
15631
  }
15635
15632
  node = parent2.parent;
15636
15633
  break;
15637
15634
  default:
15638
- return void 0;
15635
+ return 0 /* None */;
15639
15636
  }
15640
15637
  parent2 = node.parent;
15641
15638
  }
15642
15639
  }
15643
- function getAssignmentTargetKind(node) {
15644
- const target = getAssignmentTarget(node);
15645
- if (!target) {
15646
- return 0 /* None */;
15647
- }
15648
- switch (target.kind) {
15649
- case 226 /* BinaryExpression */:
15650
- const binaryOperator = target.operatorToken.kind;
15651
- return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */;
15652
- case 224 /* PrefixUnaryExpression */:
15653
- case 225 /* PostfixUnaryExpression */:
15654
- return 2 /* Compound */;
15655
- case 249 /* ForInStatement */:
15656
- case 250 /* ForOfStatement */:
15657
- return 1 /* Definite */;
15658
- }
15659
- }
15660
15640
  function isAssignmentTarget(node) {
15661
- return !!getAssignmentTarget(node);
15662
- }
15663
- function isCompoundLikeAssignment(assignment) {
15664
- const right = skipParentheses(assignment.right);
15665
- return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind);
15666
- }
15667
- function isInCompoundLikeAssignment(node) {
15668
- const target = getAssignmentTarget(node);
15669
- return !!target && isAssignmentExpression(
15670
- target,
15671
- /*excludeCompoundAssignment*/
15672
- true
15673
- ) && isCompoundLikeAssignment(target);
15641
+ return getAssignmentTargetKind(node) !== 0 /* None */;
15674
15642
  }
15675
15643
  function isNodeWithPossibleHoistedDeclaration(node) {
15676
15644
  switch (node.kind) {
@@ -46221,7 +46189,7 @@ ${lanes.join("\n")}
46221
46189
  };
46222
46190
  var amalgamatedDuplicates;
46223
46191
  var reverseMappedCache = /* @__PURE__ */ new Map();
46224
- var inInferTypeForHomomorphicMappedType = false;
46192
+ var homomorphicMappedTypeInferenceStack = [];
46225
46193
  var ambientModulesCache;
46226
46194
  var patternAmbientModules;
46227
46195
  var patternAmbientModuleAugmentations;
@@ -64575,7 +64543,7 @@ ${lanes.join("\n")}
64575
64543
  }
64576
64544
  }
64577
64545
  }
64578
- const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i])) : target;
64546
+ const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i]), 0 /* None */) : target;
64579
64547
  return filtered.flags & 131072 /* Never */ ? target : filtered;
64580
64548
  }
64581
64549
  function isWeakType(type) {
@@ -65609,17 +65577,18 @@ ${lanes.join("\n")}
65609
65577
  );
65610
65578
  }
65611
65579
  function inferTypeForHomomorphicMappedType(source, target, constraint) {
65612
- if (inInferTypeForHomomorphicMappedType) {
65613
- return void 0;
65580
+ const cacheKey = source.id + "," + target.id + "," + constraint.id;
65581
+ if (reverseMappedCache.has(cacheKey)) {
65582
+ return reverseMappedCache.get(cacheKey);
65614
65583
  }
65615
- const key = source.id + "," + target.id + "," + constraint.id;
65616
- if (reverseMappedCache.has(key)) {
65617
- return reverseMappedCache.get(key);
65584
+ const recursionKey = source.id + "," + (target.target || target).id;
65585
+ if (contains(homomorphicMappedTypeInferenceStack, recursionKey)) {
65586
+ return void 0;
65618
65587
  }
65619
- inInferTypeForHomomorphicMappedType = true;
65588
+ homomorphicMappedTypeInferenceStack.push(recursionKey);
65620
65589
  const type = createReverseMappedType(source, target, constraint);
65621
- inInferTypeForHomomorphicMappedType = false;
65622
- reverseMappedCache.set(key, type);
65590
+ homomorphicMappedTypeInferenceStack.pop();
65591
+ reverseMappedCache.set(cacheKey, type);
65623
65592
  return type;
65624
65593
  }
65625
65594
  function isPartiallyInferableType(type) {
@@ -67646,11 +67615,10 @@ ${lanes.join("\n")}
67646
67615
  const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow));
67647
67616
  return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
67648
67617
  }
67649
- const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType;
67650
- if (t.flags & 1048576 /* Union */) {
67651
- return getAssignmentReducedType(t, getInitialOrAssignedType(flow));
67618
+ if (declaredType.flags & 1048576 /* Union */) {
67619
+ return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow));
67652
67620
  }
67653
- return t;
67621
+ return declaredType;
67654
67622
  }
67655
67623
  if (containsMatchingReference(reference, node)) {
67656
67624
  if (!isReachableFlowNode(flow)) {
@@ -68779,7 +68747,7 @@ ${lanes.join("\n")}
68779
68747
  const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */;
68780
68748
  if (localOrExportSymbol.flags & 3 /* Variable */) {
68781
68749
  if (assignmentKind === 1 /* Definite */) {
68782
- return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type;
68750
+ return type;
68783
68751
  }
68784
68752
  } else if (isAlias) {
68785
68753
  declaration = getDeclarationOfAliasSymbol(symbol);
@@ -172785,7 +172753,6 @@ ${options.prefix}` : "\n" : options.prefix
172785
172753
  isImportTypeNode: () => isImportTypeNode,
172786
172754
  isImportableFile: () => isImportableFile,
172787
172755
  isInComment: () => isInComment,
172788
- isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
172789
172756
  isInExpressionContext: () => isInExpressionContext,
172790
172757
  isInJSDoc: () => isInJSDoc,
172791
172758
  isInJSFile: () => isInJSFile,
@@ -173078,7 +173045,6 @@ ${options.prefix}` : "\n" : options.prefix
173078
173045
  isSetAccessor: () => isSetAccessor,
173079
173046
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
173080
173047
  isShebangTrivia: () => isShebangTrivia,
173081
- isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
173082
173048
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
173083
173049
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
173084
173050
  isSignedNumericLiteral: () => isSignedNumericLiteral,
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-52493-8",
5
+ "version": "5.2.0-pr-53647-17",
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": "d2eb04a9bf92fb96607b2a314bc382456fee514d"
118
+ "gitHead": "e7c204e85a9d50cebdfc1716b45a9069ae4f0a27"
119
119
  }