typescript 5.6.0-dev.20240710 → 5.6.0-dev.20240712

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.6";
21
- var version = `${versionMajorMinor}.0-dev.20240710`;
21
+ var version = `${versionMajorMinor}.0-dev.20240712`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6761,7 +6761,7 @@ var Diagnostics = {
6761
6761
  Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
6762
6762
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
6763
6763
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
6764
- Property_0_of_exported_class_expression_may_not_be_private_or_protected: diag(4094, 1 /* Error */, "Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094", "Property '{0}' of exported class expression may not be private or protected."),
6764
+ Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected: diag(4094, 1 /* Error */, "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", "Property '{0}' of exported anonymous class type may not be private or protected."),
6765
6765
  Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4095, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095", "Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),
6766
6766
  Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4096, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096", "Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),
6767
6767
  Public_static_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4097, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097", "Public static method '{0}' of exported class has or is using private name '{1}'."),
@@ -8550,6 +8550,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8550
8550
  hasExtendedUnicodeEscape: () => (tokenFlags & 8 /* ExtendedUnicodeEscape */) !== 0,
8551
8551
  hasPrecedingLineBreak: () => (tokenFlags & 1 /* PrecedingLineBreak */) !== 0,
8552
8552
  hasPrecedingJSDocComment: () => (tokenFlags & 2 /* PrecedingJSDocComment */) !== 0,
8553
+ hasPrecedingJSDocLeadingAsterisks: () => (tokenFlags & 32768 /* PrecedingJSDocLeadingAsterisks */) !== 0,
8553
8554
  isIdentifier: () => token === 80 /* Identifier */ || token > 118 /* LastReservedWord */,
8554
8555
  isReservedWord: () => token >= 83 /* FirstReservedWord */ && token <= 118 /* LastReservedWord */,
8555
8556
  isUnterminated: () => (tokenFlags & 4 /* Unterminated */) !== 0,
@@ -9190,7 +9191,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9190
9191
  function scan() {
9191
9192
  fullStartPos = pos;
9192
9193
  tokenFlags = 0 /* None */;
9193
- let asteriskSeen = false;
9194
9194
  while (true) {
9195
9195
  tokenStart = pos;
9196
9196
  if (pos >= end) {
@@ -9306,8 +9306,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9306
9306
  return pos += 2, token = 43 /* AsteriskAsteriskToken */;
9307
9307
  }
9308
9308
  pos++;
9309
- if (skipJsDocLeadingAsterisks && !asteriskSeen && tokenFlags & 1 /* PrecedingLineBreak */) {
9310
- asteriskSeen = true;
9309
+ if (skipJsDocLeadingAsterisks && (tokenFlags & 32768 /* PrecedingJSDocLeadingAsterisks */) === 0 && tokenFlags & 1 /* PrecedingLineBreak */) {
9310
+ tokenFlags |= 32768 /* PrecedingJSDocLeadingAsterisks */;
9311
9311
  continue;
9312
9312
  }
9313
9313
  return token = 42 /* AsteriskToken */;
@@ -28948,7 +28948,7 @@ var Parser;
28948
28948
  function createIdentifier(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) {
28949
28949
  if (isIdentifier3) {
28950
28950
  identifierCount++;
28951
- const pos = getNodePos();
28951
+ const pos = scanner.hasPrecedingJSDocLeadingAsterisks() ? scanner.getTokenStart() : getNodePos();
28952
28952
  const originalKeywordKind = token();
28953
28953
  const text = internIdentifier(scanner.getTokenValue());
28954
28954
  const hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
@@ -36078,6 +36078,7 @@ var commandOptionsWithoutBuild = [
36078
36078
  type: "boolean",
36079
36079
  affectsEmit: true,
36080
36080
  affectsBuildInfo: true,
36081
+ affectsSourceFile: true,
36081
36082
  category: Diagnostics.Emit,
36082
36083
  description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
36083
36084
  defaultValueDescription: false
@@ -36542,6 +36543,7 @@ var commandOptionsWithoutBuild = [
36542
36543
  affectsEmit: true,
36543
36544
  affectsBuildInfo: true,
36544
36545
  affectsModuleResolution: true,
36546
+ affectsSourceFile: true,
36545
36547
  category: Diagnostics.Language_and_Environment,
36546
36548
  description: Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
36547
36549
  defaultValueDescription: "react"
@@ -49430,11 +49432,11 @@ function createTypeChecker(host) {
49430
49432
  function tryReuseExistingTypeNode(context, typeNode, type, host2, addUndefined) {
49431
49433
  const originalType = type;
49432
49434
  if (addUndefined) {
49433
- type = getOptionalType(type);
49435
+ type = getOptionalType(type, !isParameter(host2));
49434
49436
  }
49435
49437
  const clone = tryReuseExistingNonParameterTypeNode(context, typeNode, type, host2);
49436
49438
  if (clone) {
49437
- if (addUndefined && !someType(getTypeFromTypeNode2(context, typeNode), (t) => !!(t.flags & 32768 /* Undefined */))) {
49439
+ if (addUndefined && containsNonMissingUndefinedType(type) && !someType(getTypeFromTypeNode2(context, typeNode), (t) => !!(t.flags & 32768 /* Undefined */))) {
49438
49440
  return factory.createUnionTypeNode([clone, factory.createKeywordTypeNode(157 /* UndefinedKeyword */)]);
49439
49441
  }
49440
49442
  return clone;
@@ -51381,8 +51383,8 @@ function createTypeChecker(host) {
51381
51383
  return enclosingDeclaration;
51382
51384
  }
51383
51385
  function serializeTypeForDeclaration(context, declaration, type, symbol) {
51384
- var _a;
51385
- const addUndefined = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration);
51386
+ var _a, _b;
51387
+ const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration);
51386
51388
  const enclosingDeclaration = context.enclosingDeclaration;
51387
51389
  const oldFlags = context.flags;
51388
51390
  if (declaration && hasInferredType(declaration) && !(context.flags & -2147483648 /* NoSyntacticPrinter */)) {
@@ -51393,6 +51395,7 @@ function createTypeChecker(host) {
51393
51395
  const declWithExistingAnnotation = declaration && getNonlocalEffectiveTypeAnnotationNode(declaration) ? declaration : getDeclarationWithTypeAnnotation(symbol);
51394
51396
  if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
51395
51397
  const existing = getNonlocalEffectiveTypeAnnotationNode(declWithExistingAnnotation);
51398
+ const addUndefined = addUndefinedForParameter || !!(symbol.flags & 4 /* Property */ && symbol.flags & 16777216 /* Optional */ && isOptionalDeclaration(declWithExistingAnnotation) && ((_a = symbol.links) == null ? void 0 : _a.mappedType) && containsNonMissingUndefinedType(type));
51396
51399
  const result2 = !isTypePredicateNode(existing) && tryReuseExistingTypeNode(context, existing, type, declWithExistingAnnotation, addUndefined);
51397
51400
  if (result2) {
51398
51401
  context.flags = oldFlags;
@@ -51403,9 +51406,9 @@ function createTypeChecker(host) {
51403
51406
  if (type.flags & 8192 /* UniqueESSymbol */ && type.symbol === symbol && (!context.enclosingDeclaration || some(symbol.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)))) {
51404
51407
  context.flags |= 1048576 /* AllowUniqueESSymbolType */;
51405
51408
  }
51406
- const decl = declaration ?? symbol.valueDeclaration ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]);
51409
+ const decl = declaration ?? symbol.valueDeclaration ?? ((_b = symbol.declarations) == null ? void 0 : _b[0]);
51407
51410
  const expr = decl && isDeclarationWithPossibleInnerTypeNodeReuse(decl) ? getPossibleTypeNodeReuseExpression(decl) : void 0;
51408
- const result = expressionOrTypeToTypeNode(context, expr, type, addUndefined);
51411
+ const result = expressionOrTypeToTypeNode(context, expr, type, addUndefinedForParameter);
51409
51412
  context.flags = oldFlags;
51410
51413
  return result;
51411
51414
  }
@@ -62686,6 +62689,10 @@ function createTypeChecker(host) {
62686
62689
  function containsUndefinedType(type) {
62687
62690
  return !!((type.flags & 1048576 /* Union */ ? type.types[0] : type).flags & 32768 /* Undefined */);
62688
62691
  }
62692
+ function containsNonMissingUndefinedType(type) {
62693
+ const candidate = type.flags & 1048576 /* Union */ ? type.types[0] : type;
62694
+ return !!(candidate.flags & 32768 /* Undefined */) && candidate !== missingType;
62695
+ }
62689
62696
  function isStringIndexSignatureOnlyType(type) {
62690
62697
  return type.flags & 524288 /* Object */ && !isGenericMappedType(type) && getPropertiesOfType(type).length === 0 && getIndexInfosOfType(type).length === 1 && !!getIndexInfoOfType(type, stringType) || type.flags & 3145728 /* UnionOrIntersection */ && every(type.types, isStringIndexSignatureOnlyType) || false;
62691
62698
  }
@@ -111040,7 +111047,10 @@ function transformDeclarations(context) {
111040
111047
  function reportPrivateInBaseOfClassExpression(propertyName) {
111041
111048
  if (errorNameNode || errorFallbackNode) {
111042
111049
  context.addDiagnostic(
111043
- createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.Property_0_of_exported_class_expression_may_not_be_private_or_protected, propertyName)
111050
+ addRelatedInfo(
111051
+ createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected, propertyName),
111052
+ ...isVariableDeclaration((errorNameNode || errorFallbackNode).parent) ? [createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.Add_a_type_annotation_to_the_variable_0, errorDeclarationNameWithFallback())] : []
111053
+ )
111044
111054
  );
111045
111055
  }
111046
111056
  }
package/lib/typescript.js CHANGED
@@ -2251,7 +2251,7 @@ module.exports = __toCommonJS(typescript_exports);
2251
2251
 
2252
2252
  // src/compiler/corePublic.ts
2253
2253
  var versionMajorMinor = "5.6";
2254
- var version = `${versionMajorMinor}.0-dev.20240710`;
2254
+ var version = `${versionMajorMinor}.0-dev.20240712`;
2255
2255
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2256
2256
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2257
2257
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6028,6 +6028,7 @@ var TokenFlags = /* @__PURE__ */ ((TokenFlags2) => {
6028
6028
  TokenFlags2[TokenFlags2["HexEscape"] = 4096] = "HexEscape";
6029
6029
  TokenFlags2[TokenFlags2["ContainsLeadingZero"] = 8192] = "ContainsLeadingZero";
6030
6030
  TokenFlags2[TokenFlags2["ContainsInvalidSeparator"] = 16384] = "ContainsInvalidSeparator";
6031
+ TokenFlags2[TokenFlags2["PrecedingJSDocLeadingAsterisks"] = 32768] = "PrecedingJSDocLeadingAsterisks";
6031
6032
  TokenFlags2[TokenFlags2["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier";
6032
6033
  TokenFlags2[TokenFlags2["WithSpecifier"] = 448] = "WithSpecifier";
6033
6034
  TokenFlags2[TokenFlags2["StringLiteralFlags"] = 7176] = "StringLiteralFlags";
@@ -10140,7 +10141,7 @@ var Diagnostics = {
10140
10141
  Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
10141
10142
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
10142
10143
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
10143
- Property_0_of_exported_class_expression_may_not_be_private_or_protected: diag(4094, 1 /* Error */, "Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094", "Property '{0}' of exported class expression may not be private or protected."),
10144
+ Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected: diag(4094, 1 /* Error */, "Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected_4094", "Property '{0}' of exported anonymous class type may not be private or protected."),
10144
10145
  Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4095, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095", "Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),
10145
10146
  Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4096, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096", "Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),
10146
10147
  Public_static_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4097, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097", "Public static method '{0}' of exported class has or is using private name '{1}'."),
@@ -11953,6 +11954,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
11953
11954
  hasExtendedUnicodeEscape: () => (tokenFlags & 8 /* ExtendedUnicodeEscape */) !== 0,
11954
11955
  hasPrecedingLineBreak: () => (tokenFlags & 1 /* PrecedingLineBreak */) !== 0,
11955
11956
  hasPrecedingJSDocComment: () => (tokenFlags & 2 /* PrecedingJSDocComment */) !== 0,
11957
+ hasPrecedingJSDocLeadingAsterisks: () => (tokenFlags & 32768 /* PrecedingJSDocLeadingAsterisks */) !== 0,
11956
11958
  isIdentifier: () => token === 80 /* Identifier */ || token > 118 /* LastReservedWord */,
11957
11959
  isReservedWord: () => token >= 83 /* FirstReservedWord */ && token <= 118 /* LastReservedWord */,
11958
11960
  isUnterminated: () => (tokenFlags & 4 /* Unterminated */) !== 0,
@@ -12593,7 +12595,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12593
12595
  function scan() {
12594
12596
  fullStartPos = pos;
12595
12597
  tokenFlags = 0 /* None */;
12596
- let asteriskSeen = false;
12597
12598
  while (true) {
12598
12599
  tokenStart = pos;
12599
12600
  if (pos >= end) {
@@ -12709,8 +12710,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12709
12710
  return pos += 2, token = 43 /* AsteriskAsteriskToken */;
12710
12711
  }
12711
12712
  pos++;
12712
- if (skipJsDocLeadingAsterisks && !asteriskSeen && tokenFlags & 1 /* PrecedingLineBreak */) {
12713
- asteriskSeen = true;
12713
+ if (skipJsDocLeadingAsterisks && (tokenFlags & 32768 /* PrecedingJSDocLeadingAsterisks */) === 0 && tokenFlags & 1 /* PrecedingLineBreak */) {
12714
+ tokenFlags |= 32768 /* PrecedingJSDocLeadingAsterisks */;
12714
12715
  continue;
12715
12716
  }
12716
12717
  return token = 42 /* AsteriskToken */;
@@ -33200,7 +33201,7 @@ var Parser;
33200
33201
  function createIdentifier(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) {
33201
33202
  if (isIdentifier3) {
33202
33203
  identifierCount++;
33203
- const pos = getNodePos();
33204
+ const pos = scanner2.hasPrecedingJSDocLeadingAsterisks() ? scanner2.getTokenStart() : getNodePos();
33204
33205
  const originalKeywordKind = token();
33205
33206
  const text = internIdentifier(scanner2.getTokenValue());
33206
33207
  const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape();
@@ -40330,6 +40331,7 @@ var commandOptionsWithoutBuild = [
40330
40331
  type: "boolean",
40331
40332
  affectsEmit: true,
40332
40333
  affectsBuildInfo: true,
40334
+ affectsSourceFile: true,
40333
40335
  category: Diagnostics.Emit,
40334
40336
  description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
40335
40337
  defaultValueDescription: false
@@ -40794,6 +40796,7 @@ var commandOptionsWithoutBuild = [
40794
40796
  affectsEmit: true,
40795
40797
  affectsBuildInfo: true,
40796
40798
  affectsModuleResolution: true,
40799
+ affectsSourceFile: true,
40797
40800
  category: Diagnostics.Language_and_Environment,
40798
40801
  description: Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
40799
40802
  defaultValueDescription: "react"
@@ -54031,11 +54034,11 @@ function createTypeChecker(host) {
54031
54034
  function tryReuseExistingTypeNode(context, typeNode, type, host2, addUndefined) {
54032
54035
  const originalType = type;
54033
54036
  if (addUndefined) {
54034
- type = getOptionalType(type);
54037
+ type = getOptionalType(type, !isParameter(host2));
54035
54038
  }
54036
54039
  const clone2 = tryReuseExistingNonParameterTypeNode(context, typeNode, type, host2);
54037
54040
  if (clone2) {
54038
- if (addUndefined && !someType(getTypeFromTypeNode2(context, typeNode), (t) => !!(t.flags & 32768 /* Undefined */))) {
54041
+ if (addUndefined && containsNonMissingUndefinedType(type) && !someType(getTypeFromTypeNode2(context, typeNode), (t) => !!(t.flags & 32768 /* Undefined */))) {
54039
54042
  return factory.createUnionTypeNode([clone2, factory.createKeywordTypeNode(157 /* UndefinedKeyword */)]);
54040
54043
  }
54041
54044
  return clone2;
@@ -55982,8 +55985,8 @@ function createTypeChecker(host) {
55982
55985
  return enclosingDeclaration;
55983
55986
  }
55984
55987
  function serializeTypeForDeclaration(context, declaration, type, symbol) {
55985
- var _a;
55986
- const addUndefined = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration);
55988
+ var _a, _b;
55989
+ const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration);
55987
55990
  const enclosingDeclaration = context.enclosingDeclaration;
55988
55991
  const oldFlags = context.flags;
55989
55992
  if (declaration && hasInferredType(declaration) && !(context.flags & -2147483648 /* NoSyntacticPrinter */)) {
@@ -55994,6 +55997,7 @@ function createTypeChecker(host) {
55994
55997
  const declWithExistingAnnotation = declaration && getNonlocalEffectiveTypeAnnotationNode(declaration) ? declaration : getDeclarationWithTypeAnnotation(symbol);
55995
55998
  if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
55996
55999
  const existing = getNonlocalEffectiveTypeAnnotationNode(declWithExistingAnnotation);
56000
+ const addUndefined = addUndefinedForParameter || !!(symbol.flags & 4 /* Property */ && symbol.flags & 16777216 /* Optional */ && isOptionalDeclaration(declWithExistingAnnotation) && ((_a = symbol.links) == null ? void 0 : _a.mappedType) && containsNonMissingUndefinedType(type));
55997
56001
  const result2 = !isTypePredicateNode(existing) && tryReuseExistingTypeNode(context, existing, type, declWithExistingAnnotation, addUndefined);
55998
56002
  if (result2) {
55999
56003
  context.flags = oldFlags;
@@ -56004,9 +56008,9 @@ function createTypeChecker(host) {
56004
56008
  if (type.flags & 8192 /* UniqueESSymbol */ && type.symbol === symbol && (!context.enclosingDeclaration || some(symbol.declarations, (d) => getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration)))) {
56005
56009
  context.flags |= 1048576 /* AllowUniqueESSymbolType */;
56006
56010
  }
56007
- const decl = declaration ?? symbol.valueDeclaration ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]);
56011
+ const decl = declaration ?? symbol.valueDeclaration ?? ((_b = symbol.declarations) == null ? void 0 : _b[0]);
56008
56012
  const expr = decl && isDeclarationWithPossibleInnerTypeNodeReuse(decl) ? getPossibleTypeNodeReuseExpression(decl) : void 0;
56009
- const result = expressionOrTypeToTypeNode(context, expr, type, addUndefined);
56013
+ const result = expressionOrTypeToTypeNode(context, expr, type, addUndefinedForParameter);
56010
56014
  context.flags = oldFlags;
56011
56015
  return result;
56012
56016
  }
@@ -67287,6 +67291,10 @@ function createTypeChecker(host) {
67287
67291
  function containsUndefinedType(type) {
67288
67292
  return !!((type.flags & 1048576 /* Union */ ? type.types[0] : type).flags & 32768 /* Undefined */);
67289
67293
  }
67294
+ function containsNonMissingUndefinedType(type) {
67295
+ const candidate = type.flags & 1048576 /* Union */ ? type.types[0] : type;
67296
+ return !!(candidate.flags & 32768 /* Undefined */) && candidate !== missingType;
67297
+ }
67290
67298
  function isStringIndexSignatureOnlyType(type) {
67291
67299
  return type.flags & 524288 /* Object */ && !isGenericMappedType(type) && getPropertiesOfType(type).length === 0 && getIndexInfosOfType(type).length === 1 && !!getIndexInfoOfType(type, stringType) || type.flags & 3145728 /* UnionOrIntersection */ && every(type.types, isStringIndexSignatureOnlyType) || false;
67292
67300
  }
@@ -115823,7 +115831,10 @@ function transformDeclarations(context) {
115823
115831
  function reportPrivateInBaseOfClassExpression(propertyName) {
115824
115832
  if (errorNameNode || errorFallbackNode) {
115825
115833
  context.addDiagnostic(
115826
- createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.Property_0_of_exported_class_expression_may_not_be_private_or_protected, propertyName)
115834
+ addRelatedInfo(
115835
+ createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.Property_0_of_exported_anonymous_class_type_may_not_be_private_or_protected, propertyName),
115836
+ ...isVariableDeclaration((errorNameNode || errorFallbackNode).parent) ? [createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.Add_a_type_annotation_to_the_variable_0, errorDeclarationNameWithFallback())] : []
115837
+ )
115827
115838
  );
115828
115839
  }
115829
115840
  }
@@ -138879,6 +138890,7 @@ function isImportableSymbol(symbol, checker) {
138879
138890
  function forEachNameOfDefaultExport(defaultExport, checker, compilerOptions, preferCapitalizedNames, cb) {
138880
138891
  let chain;
138881
138892
  let current = defaultExport;
138893
+ const seen = /* @__PURE__ */ new Map();
138882
138894
  while (current) {
138883
138895
  const fromDeclaration = getDefaultLikeExportNameFromDeclaration(current);
138884
138896
  if (fromDeclaration) {
@@ -138890,6 +138902,7 @@ function forEachNameOfDefaultExport(defaultExport, checker, compilerOptions, pre
138890
138902
  if (final) return final;
138891
138903
  }
138892
138904
  chain = append(chain, current);
138905
+ if (!addToSeen(seen, current)) break;
138893
138906
  current = current.flags & 2097152 /* Alias */ ? checker.getImmediateAliasedSymbol(current) : void 0;
138894
138907
  }
138895
138908
  for (const symbol of chain ?? emptyArray) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.6.0-dev.20240710",
5
+ "version": "5.6.0-dev.20240712",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "20.1.0",
114
114
  "npm": "8.19.4"
115
115
  },
116
- "gitHead": "a6a0f4ad58fc0d1a66c4a844dbeb53a855c13ab5"
116
+ "gitHead": "46410044add2e9f53cea58e445de18dcda53443f"
117
117
  }