@typescript-deploys/pr-build 4.8.0-pr-48784-14 → 4.8.0-pr-48784-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
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.8";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20220527";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220601";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -5610,6 +5610,7 @@ var ts;
5610
5610
  Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, ts.DiagnosticCategory.Error, "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", undefined, true),
5611
5611
  The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),
5612
5612
  The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),
5613
+ This_type_parameter_probably_needs_an_extends_object_constraint: diag(2208, ts.DiagnosticCategory.Error, "This_type_parameter_probably_needs_an_extends_object_constraint_2208", "This type parameter probably needs an `extends object` constraint."),
5613
5614
  The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2209, ts.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209", "The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
5614
5615
  The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, ts.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
5615
5616
  Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
@@ -6095,6 +6096,7 @@ var ts;
6095
6096
  Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
6096
6097
  All_declarations_of_0_must_have_identical_constraints: diag(2838, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
6097
6098
  This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, ts.DiagnosticCategory.Error, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
6099
+ An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, ts.DiagnosticCategory.Error, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"),
6098
6100
  Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
6099
6101
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
6100
6102
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -36212,8 +36214,7 @@ var ts;
36212
36214
  var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
36213
36215
  loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
36214
36216
  if (!pathAndExtension && packageInfo
36215
- && packageInfo.packageJsonContent.exports === undefined
36216
- && packageInfo.packageJsonContent.main === undefined
36217
+ && (packageInfo.packageJsonContent.exports === undefined || packageInfo.packageJsonContent.exports === null)
36217
36218
  && state.features & NodeResolutionFeatures.EsmMode) {
36218
36219
  pathAndExtension = loadModuleFromFile(extensions, ts.combinePaths(candidate, "index.js"), onlyRecordFailures, state);
36219
36220
  }
@@ -39850,6 +39851,7 @@ var ts;
39850
39851
  var emptyTypeLiteralSymbol = createSymbol(2048, "__type");
39851
39852
  emptyTypeLiteralSymbol.members = ts.createSymbolTable();
39852
39853
  var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
39854
+ var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray)]) : unknownType;
39853
39855
  var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
39854
39856
  emptyGenericType.instantiations = new ts.Map();
39855
39857
  var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
@@ -41136,7 +41138,12 @@ var ts;
41136
41138
  function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
41137
41139
  if (meaning & (111551 & ~1024)) {
41138
41140
  if (isPrimitiveTypeName(name)) {
41139
- error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
41141
+ if (isExtendedByInterface(errorLocation)) {
41142
+ error(errorLocation, ts.Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes, ts.unescapeLeadingUnderscores(name));
41143
+ }
41144
+ else {
41145
+ error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
41146
+ }
41140
41147
  return true;
41141
41148
  }
41142
41149
  var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 & ~111551, undefined, undefined, false));
@@ -41156,6 +41163,16 @@ var ts;
41156
41163
  }
41157
41164
  return false;
41158
41165
  }
41166
+ function isExtendedByInterface(node) {
41167
+ var grandparent = node.parent.parent;
41168
+ var parentOfGrandparent = grandparent.parent;
41169
+ if (grandparent && parentOfGrandparent) {
41170
+ var isExtending = ts.isHeritageClause(grandparent) && grandparent.token === 94;
41171
+ var isInterface = ts.isInterfaceDeclaration(parentOfGrandparent);
41172
+ return isExtending && isInterface;
41173
+ }
41174
+ return false;
41175
+ }
41159
41176
  function maybeMappedType(node, symbol) {
41160
41177
  var container = ts.findAncestor(node.parent, function (n) {
41161
41178
  return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit";
@@ -43682,7 +43699,7 @@ var ts;
43682
43699
  anyType : getNonMissingTypeOfSymbol(propertySymbol);
43683
43700
  var saveEnclosingDeclaration = context.enclosingDeclaration;
43684
43701
  context.enclosingDeclaration = undefined;
43685
- if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 4096 && isLateBoundName(propertySymbol.escapedName)) {
43702
+ if (context.tracker.trackSymbol && isLateBoundName(propertySymbol.escapedName)) {
43686
43703
  if (propertySymbol.declarations) {
43687
43704
  var decl = ts.first(propertySymbol.declarations);
43688
43705
  if (hasLateBindableName(decl)) {
@@ -45137,7 +45154,7 @@ var ts;
45137
45154
  ? getBaseConstructorTypeOfClass(staticType)
45138
45155
  : anyType;
45139
45156
  var heritageClauses = __spreadArray(__spreadArray([], !ts.length(baseTypes) ? [] : [ts.factory.createHeritageClause(94, ts.map(baseTypes, function (b) { return serializeBaseType(b, staticBaseType, localName); }))], true), !ts.length(implementsExpressions) ? [] : [ts.factory.createHeritageClause(117, implementsExpressions)], true);
45140
- var symbolProps = getNonInterhitedProperties(classType, baseTypes, getPropertiesOfType(classType));
45157
+ var symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType));
45141
45158
  var publicSymbolProps = ts.filter(symbolProps, function (s) {
45142
45159
  var valueDecl = s.valueDeclaration;
45143
45160
  return !!valueDecl && !(ts.isNamedDeclaration(valueDecl) && ts.isPrivateIdentifier(valueDecl.name));
@@ -46051,7 +46068,7 @@ var ts;
46051
46068
  return type;
46052
46069
  }
46053
46070
  if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
46054
- return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration, 0)) & 32768) ? getNonUndefinedType(type) : type;
46071
+ return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer(declaration, 0)) & 16777216) ? getNonUndefinedType(type) : type;
46055
46072
  }
46056
46073
  return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0)], 2));
46057
46074
  }
@@ -48659,7 +48676,7 @@ var ts;
48659
48676
  }
48660
48677
  }
48661
48678
  }
48662
- else if (t.flags & 469892092) {
48679
+ else if (t.flags & 469892092 || isEmptyAnonymousObjectType(t)) {
48663
48680
  hasDisjointDomainType = true;
48664
48681
  }
48665
48682
  }
@@ -48667,7 +48684,7 @@ var ts;
48667
48684
  if (hasDisjointDomainType) {
48668
48685
  for (var _a = 0, types_6 = types; _a < types_6.length; _a++) {
48669
48686
  var t = types_6[_a];
48670
- if (t.flags & 469892092) {
48687
+ if (t.flags & 469892092 || isEmptyAnonymousObjectType(t)) {
48671
48688
  constraints = ts.append(constraints, t);
48672
48689
  }
48673
48690
  }
@@ -48839,7 +48856,7 @@ var ts;
48839
48856
  var objectType;
48840
48857
  return !!(type.flags & 8388608 && ts.getObjectFlags(objectType = type.objectType) & 32 &&
48841
48858
  !isGenericMappedType(objectType) && isGenericIndexType(type.indexType) &&
48842
- !objectType.declaration.questionToken && !objectType.declaration.nameType);
48859
+ !(getMappedTypeModifiers(objectType) & 8) && !objectType.declaration.nameType);
48843
48860
  }
48844
48861
  function getApparentType(type) {
48845
48862
  var t = !(type.flags & 465829888) ? type : getBaseConstraintOfType(type) || unknownType;
@@ -50937,7 +50954,7 @@ var ts;
50937
50954
  }
50938
50955
  return includes;
50939
50956
  }
50940
- function removeRedundantPrimitiveTypes(types, includes) {
50957
+ function removeRedundantSupertypes(types, includes) {
50941
50958
  var i = types.length;
50942
50959
  while (i > 0) {
50943
50960
  i--;
@@ -50945,7 +50962,9 @@ var ts;
50945
50962
  var remove = t.flags & 4 && includes & (128 | 134217728 | 268435456) ||
50946
50963
  t.flags & 8 && includes & 256 ||
50947
50964
  t.flags & 64 && includes & 2048 ||
50948
- t.flags & 4096 && includes & 8192;
50965
+ t.flags & 4096 && includes & 8192 ||
50966
+ t.flags & 16384 && includes & 32768 ||
50967
+ isEmptyAnonymousObjectType(t) && includes & 470302716;
50949
50968
  if (remove) {
50950
50969
  ts.orderedRemoveItemAt(types, i);
50951
50970
  }
@@ -51040,7 +51059,7 @@ var ts;
51040
51059
  result.aliasTypeArguments = aliasTypeArguments;
51041
51060
  return result;
51042
51061
  }
51043
- function getIntersectionType(types, aliasSymbol, aliasTypeArguments) {
51062
+ function getIntersectionType(types, aliasSymbol, aliasTypeArguments, noSupertypeReduction) {
51044
51063
  var typeMembershipMap = new ts.Map();
51045
51064
  var includes = addTypesToIntersection(typeMembershipMap, 0, types);
51046
51065
  var typeSet = ts.arrayFrom(typeMembershipMap.values());
@@ -51068,11 +51087,11 @@ var ts;
51068
51087
  if (includes & 4 && includes & (128 | 134217728 | 268435456) ||
51069
51088
  includes & 8 && includes & 256 ||
51070
51089
  includes & 64 && includes & 2048 ||
51071
- includes & 4096 && includes & 8192) {
51072
- removeRedundantPrimitiveTypes(typeSet, includes);
51073
- }
51074
- if (includes & 16777216 && includes & 524288) {
51075
- ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
51090
+ includes & 4096 && includes & 8192 ||
51091
+ includes & 16384 && includes & 32768 ||
51092
+ includes & 16777216 && includes & 470302716) {
51093
+ if (!noSupertypeReduction)
51094
+ removeRedundantSupertypes(typeSet, includes);
51076
51095
  }
51077
51096
  if (includes & 262144) {
51078
51097
  typeSet[typeSet.indexOf(undefinedType)] = missingType;
@@ -51104,7 +51123,7 @@ var ts;
51104
51123
  return errorType;
51105
51124
  }
51106
51125
  var constituents = getCrossProductIntersections(typeSet);
51107
- var origin = ts.some(constituents, function (t) { return !!(t.flags & 2097152); }) ? createOriginUnionOrIntersectionType(2097152, typeSet) : undefined;
51126
+ var origin = ts.some(constituents, function (t) { return !!(t.flags & 2097152); }) && getConstituentCountOfTypes(constituents) > getConstituentCountOfTypes(typeSet) ? createOriginUnionOrIntersectionType(2097152, typeSet) : undefined;
51108
51127
  result = getUnionType(constituents, 1, aliasSymbol, aliasTypeArguments, origin);
51109
51128
  }
51110
51129
  }
@@ -51147,11 +51166,21 @@ var ts;
51147
51166
  }
51148
51167
  return intersections;
51149
51168
  }
51169
+ function getConstituentCount(type) {
51170
+ return !(type.flags & 3145728) || type.aliasSymbol ? 1 :
51171
+ type.flags & 1048576 && type.origin ? getConstituentCount(type.origin) :
51172
+ getConstituentCountOfTypes(type.types);
51173
+ }
51174
+ function getConstituentCountOfTypes(types) {
51175
+ return ts.reduceLeft(types, function (n, t) { return n + getConstituentCount(t); }, 0);
51176
+ }
51150
51177
  function getTypeFromIntersectionTypeNode(node) {
51151
51178
  var links = getNodeLinks(node);
51152
51179
  if (!links.resolvedType) {
51153
51180
  var aliasSymbol = getAliasSymbolForTypeNode(node);
51154
- links.resolvedType = getIntersectionType(ts.map(node.types, getTypeFromTypeNode), aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
51181
+ var types = ts.map(node.types, getTypeFromTypeNode);
51182
+ var noSupertypeReduction = types.length === 2 && !!(types[0].flags & (4 | 8 | 64)) && types[1] === emptyTypeLiteralType;
51183
+ links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
51155
51184
  }
51156
51185
  return links.resolvedType;
51157
51186
  }
@@ -53526,7 +53555,7 @@ var ts;
53526
53555
  var sourceSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
53527
53556
  var targetSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(targetType));
53528
53557
  var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) &&
53529
- (getFalsyFlags(sourceType) & 98304) === (getFalsyFlags(targetType) & 98304);
53558
+ (getTypeFacts(sourceType) & 50331648) === (getTypeFacts(targetType) & 50331648);
53530
53559
  var related = callbacks ?
53531
53560
  compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8) | (strictVariance ? 2 : 1), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) :
53532
53561
  !(checkMode & 3) && !strictVariance && compareTypes(sourceType, targetType, false) || compareTypes(targetType, sourceType, reportErrors);
@@ -53630,6 +53659,17 @@ var ts;
53630
53659
  return !!(ts.getObjectFlags(type) & 16 && (type.members && isEmptyResolvedType(type) ||
53631
53660
  type.symbol && type.symbol.flags & 2048 && getMembersOfSymbol(type.symbol).size === 0));
53632
53661
  }
53662
+ function isUnknownLikeUnionType(type) {
53663
+ if (strictNullChecks && type.flags & 1048576) {
53664
+ if (!(type.objectFlags & 33554432)) {
53665
+ var types = type.types;
53666
+ type.objectFlags |= 33554432 | (types.length >= 3 && types[0].flags & 32768 &&
53667
+ types[1].flags & 65536 && ts.some(types, isEmptyAnonymousObjectType) ? 67108864 : 0);
53668
+ }
53669
+ return !!(type.objectFlags & 67108864);
53670
+ }
53671
+ return false;
53672
+ }
53633
53673
  function isStringIndexSignatureOnlyType(type) {
53634
53674
  return type.flags & 524288 && !isGenericMappedType(type) && getPropertiesOfType(type).length === 0 && getIndexInfosOfType(type).length === 1 && !!getIndexInfoOfType(type, stringType) ||
53635
53675
  type.flags & 3145728 && ts.every(type.types, isStringIndexSignatureOnlyType) ||
@@ -53707,13 +53747,15 @@ var ts;
53707
53747
  return true;
53708
53748
  if (s & 65536 && (!strictNullChecks && !(t & 3145728) || t & 65536))
53709
53749
  return true;
53710
- if (s & 524288 && t & 67108864)
53750
+ if (s & 524288 && t & 67108864 && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source)))
53711
53751
  return true;
53712
53752
  if (relation === assignableRelation || relation === comparableRelation) {
53713
53753
  if (s & 1)
53714
53754
  return true;
53715
53755
  if (s & (8 | 256) && !(s & 1024) && (t & 32 || relation === assignableRelation && t & 256 && t & 1024))
53716
53756
  return true;
53757
+ if (isUnknownLikeUnionType(target))
53758
+ return true;
53717
53759
  }
53718
53760
  return false;
53719
53761
  }
@@ -53755,16 +53797,27 @@ var ts;
53755
53797
  function getNormalizedType(type, writing) {
53756
53798
  while (true) {
53757
53799
  var t = isFreshLiteralType(type) ? type.regularType :
53758
- ts.getObjectFlags(type) & 4 && type.node ? createTypeReference(type.target, getTypeArguments(type)) :
53759
- type.flags & 3145728 ? getReducedType(type) :
53800
+ ts.getObjectFlags(type) & 4 ? type.node ? createTypeReference(type.target, getTypeArguments(type)) : getSingleBaseForNonAugmentingSubtype(type) || type :
53801
+ type.flags & 3145728 ? getNormalizedUnionOrIntersectionType(type, writing) :
53760
53802
  type.flags & 33554432 ? writing ? type.baseType : type.substitute :
53761
53803
  type.flags & 25165824 ? getSimplifiedType(type, writing) :
53762
53804
  type;
53763
- t = getSingleBaseForNonAugmentingSubtype(t) || t;
53764
53805
  if (t === type)
53765
- break;
53806
+ return t;
53766
53807
  type = t;
53767
53808
  }
53809
+ }
53810
+ function getNormalizedUnionOrIntersectionType(type, writing) {
53811
+ var reduced = getReducedType(type);
53812
+ if (reduced !== type) {
53813
+ return reduced;
53814
+ }
53815
+ if (type.flags & 2097152) {
53816
+ var normalizedTypes = ts.sameMap(type.types, function (t) { return getNormalizedType(t, writing); });
53817
+ if (normalizedTypes !== type.types) {
53818
+ return getIntersectionType(normalizedTypes);
53819
+ }
53820
+ }
53768
53821
  return type;
53769
53822
  }
53770
53823
  function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) {
@@ -54139,6 +54192,7 @@ var ts;
54139
54192
  return 0;
54140
54193
  }
54141
54194
  function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
54195
+ var _a, _b;
54142
54196
  var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
54143
54197
  var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
54144
54198
  source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
@@ -54177,6 +54231,9 @@ var ts;
54177
54231
  return;
54178
54232
  }
54179
54233
  reportRelationError(headMessage, source, target);
54234
+ if (strictNullChecks && source.flags & 8650752 && ((_b = (_a = source.symbol) === null || _a === void 0 ? void 0 : _a.declarations) === null || _b === void 0 ? void 0 : _b[0]) && !getConstraintOfType(source) && isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864))) {
54235
+ associateRelatedInfo(ts.createDiagnosticForNode(source.symbol.declarations[0], ts.Diagnostics.This_type_parameter_probably_needs_an_extends_object_constraint));
54236
+ }
54180
54237
  }
54181
54238
  function traceUnionsOrIntersectionsTooLarge(source, target) {
54182
54239
  if (!ts.tracing) {
@@ -54818,12 +54875,6 @@ var ts;
54818
54875
  if (sourceFlags & 8650752) {
54819
54876
  if (!(sourceFlags & 8388608 && targetFlags & 8388608)) {
54820
54877
  var constraint = getConstraintOfType(source) || unknownType;
54821
- if (!getConstraintOfType(source) || (sourceFlags & 262144 && constraint.flags & 1)) {
54822
- if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864), 3)) {
54823
- resetErrorInfo(saveErrorInfo);
54824
- return result;
54825
- }
54826
- }
54827
54878
  if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
54828
54879
  resetErrorInfo(saveErrorInfo);
54829
54880
  return result;
@@ -56079,9 +56130,11 @@ var ts;
56079
56130
  return getSupertypeOrUnion(types);
56080
56131
  }
56081
56132
  var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 98304); });
56082
- return primaryTypes.length ?
56083
- getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 98304) :
56084
- getUnionType(types, 2);
56133
+ if (primaryTypes.length) {
56134
+ var supertypeOrUnion = getSupertypeOrUnion(primaryTypes);
56135
+ return primaryTypes === types ? supertypeOrUnion : getUnionType(__spreadArray([supertypeOrUnion], ts.filter(types, function (t) { return !!(t.flags & 98304); }), true));
56136
+ }
56137
+ return getUnionType(types, 2);
56085
56138
  }
56086
56139
  function getCommonSubtype(types) {
56087
56140
  return ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(t, s) ? t : s; });
@@ -56259,26 +56312,8 @@ var ts;
56259
56312
  var value = _a.value;
56260
56313
  return value.base10Value === "0";
56261
56314
  }
56262
- function getFalsyFlagsOfTypes(types) {
56263
- var result = 0;
56264
- for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
56265
- var t = types_14[_i];
56266
- result |= getFalsyFlags(t);
56267
- }
56268
- return result;
56269
- }
56270
- function getFalsyFlags(type) {
56271
- return type.flags & 1048576 ? getFalsyFlagsOfTypes(type.types) :
56272
- type.flags & 128 ? type.value === "" ? 128 : 0 :
56273
- type.flags & 256 ? type.value === 0 ? 256 : 0 :
56274
- type.flags & 2048 ? isZeroBigInt(type) ? 2048 : 0 :
56275
- type.flags & 512 ? (type === falseType || type === regularFalseType) ? 512 : 0 :
56276
- type.flags & 117724;
56277
- }
56278
56315
  function removeDefinitelyFalsyTypes(type) {
56279
- return getFalsyFlags(type) & 117632 ?
56280
- filterType(type, function (t) { return !(getFalsyFlags(t) & 117632); }) :
56281
- type;
56316
+ return filterType(type, function (t) { return !!(getTypeFacts(t) & 4194304); });
56282
56317
  }
56283
56318
  function extractDefinitelyFalsyTypes(type) {
56284
56319
  return mapType(type, getDefinitelyFalsyPartOfType);
@@ -56308,16 +56343,15 @@ var ts;
56308
56343
  return type.flags & 32768 ? type : getUnionType([type, isProperty ? missingType : undefinedType]);
56309
56344
  }
56310
56345
  function getGlobalNonNullableTypeInstantiation(type) {
56311
- var reducedType = getTypeWithFacts(type, 2097152);
56312
56346
  if (!deferredGlobalNonNullableTypeAlias) {
56313
56347
  deferredGlobalNonNullableTypeAlias = getGlobalSymbol("NonNullable", 524288, undefined) || unknownSymbol;
56314
56348
  }
56315
56349
  return deferredGlobalNonNullableTypeAlias !== unknownSymbol ?
56316
- getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [reducedType]) :
56317
- reducedType;
56350
+ getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type]) :
56351
+ getIntersectionType([type, emptyObjectType]);
56318
56352
  }
56319
56353
  function getNonNullableType(type) {
56320
- return strictNullChecks ? getGlobalNonNullableTypeInstantiation(type) : type;
56354
+ return strictNullChecks ? getAdjustedTypeWithFacts(type, 2097152) : type;
56321
56355
  }
56322
56356
  function addOptionalTypeMarker(type) {
56323
56357
  return strictNullChecks ? getUnionType([type, optionalType]) : type;
@@ -57287,8 +57321,8 @@ var ts;
57287
57321
  }
57288
57322
  function getSingleTypeVariableFromIntersectionTypes(types) {
57289
57323
  var typeVariable;
57290
- for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
57291
- var type = types_15[_i];
57324
+ for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
57325
+ var type = types_14[_i];
57292
57326
  var t = type.flags & 2097152 && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); });
57293
57327
  if (!t || typeVariable && t !== typeVariable) {
57294
57328
  return undefined;
@@ -57948,8 +57982,8 @@ var ts;
57948
57982
  }
57949
57983
  }
57950
57984
  };
57951
- for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
57952
- var type = types_16[_i];
57985
+ for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
57986
+ var type = types_15[_i];
57953
57987
  var state_9 = _loop_24(type);
57954
57988
  if (typeof state_9 === "object")
57955
57989
  return state_9.value;
@@ -58048,14 +58082,16 @@ var ts;
58048
58082
  return !!(resolved.callSignatures.length || resolved.constructSignatures.length ||
58049
58083
  resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
58050
58084
  }
58051
- function getTypeFacts(type, ignoreObjects) {
58052
- if (ignoreObjects === void 0) { ignoreObjects = false; }
58085
+ function getTypeFacts(type) {
58086
+ if (type.flags & (2097152 | 465829888)) {
58087
+ type = getBaseConstraintOfType(type) || unknownType;
58088
+ }
58053
58089
  var flags = type.flags;
58054
- if (flags & 4) {
58090
+ if (flags & (4 | 268435456)) {
58055
58091
  return strictNullChecks ? 16317953 : 16776705;
58056
58092
  }
58057
- if (flags & 128) {
58058
- var isEmpty = type.value === "";
58093
+ if (flags & (128 | 134217728)) {
58094
+ var isEmpty = flags & 128 && type.value === "";
58059
58095
  return strictNullChecks ?
58060
58096
  isEmpty ? 12123649 : 7929345 :
58061
58097
  isEmpty ? 12582401 : 16776705;
@@ -58087,20 +58123,20 @@ var ts;
58087
58123
  (type === falseType || type === regularFalseType) ? 12580616 : 16774920;
58088
58124
  }
58089
58125
  if (flags & 524288) {
58090
- if (ignoreObjects) {
58091
- return 16768959;
58092
- }
58093
58126
  return ts.getObjectFlags(type) & 16 && isEmptyObjectType(type) ?
58094
- strictNullChecks ? 16318463 : 16777215 :
58127
+ strictNullChecks ? 83427327 : 83886079 :
58095
58128
  isFunctionObjectType(type) ?
58096
58129
  strictNullChecks ? 7880640 : 16728000 :
58097
58130
  strictNullChecks ? 7888800 : 16736160;
58098
58131
  }
58099
- if (flags & (16384 | 32768)) {
58132
+ if (flags & 16384) {
58100
58133
  return 9830144;
58101
58134
  }
58135
+ if (flags & 32768) {
58136
+ return 26607360;
58137
+ }
58102
58138
  if (flags & 65536) {
58103
- return 9363232;
58139
+ return 42917664;
58104
58140
  }
58105
58141
  if (flags & 12288) {
58106
58142
  return strictNullChecks ? 7925520 : 16772880;
@@ -58111,33 +58147,49 @@ var ts;
58111
58147
  if (flags & 131072) {
58112
58148
  return 0;
58113
58149
  }
58114
- if (flags & 465829888) {
58115
- return !isPatternLiteralType(type) ? getTypeFacts(getBaseConstraintOfType(type) || unknownType, ignoreObjects) :
58116
- strictNullChecks ? 7929345 : 16776705;
58117
- }
58118
58150
  if (flags & 1048576) {
58119
- return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t, ignoreObjects); }, 0);
58151
+ return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t); }, 0);
58120
58152
  }
58121
58153
  if (flags & 2097152) {
58122
- ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068));
58123
- return getIntersectionTypeFacts(type, ignoreObjects);
58154
+ return getIntersectionTypeFacts(type);
58124
58155
  }
58125
- return 16777215;
58156
+ return 83886079;
58126
58157
  }
58127
- function getIntersectionTypeFacts(type, ignoreObjects) {
58158
+ function getIntersectionTypeFacts(type) {
58159
+ var ignoreObjects = maybeTypeOfKind(type, 131068);
58128
58160
  var oredFacts = 0;
58129
- var andedFacts = 16777215;
58161
+ var andedFacts = 134217727;
58130
58162
  for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
58131
58163
  var t = _a[_i];
58132
- var f = getTypeFacts(t, ignoreObjects);
58133
- oredFacts |= f;
58134
- andedFacts &= f;
58164
+ if (!(ignoreObjects && t.flags & 524288)) {
58165
+ var f = getTypeFacts(t);
58166
+ oredFacts |= f;
58167
+ andedFacts &= f;
58168
+ }
58135
58169
  }
58136
- return oredFacts & 8256 | andedFacts & 16768959;
58170
+ return oredFacts & 8256 | andedFacts & 134209471;
58137
58171
  }
58138
58172
  function getTypeWithFacts(type, include) {
58139
58173
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
58140
58174
  }
58175
+ function getAdjustedTypeWithFacts(type, facts) {
58176
+ var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 ? unknownUnionType : type, facts));
58177
+ if (strictNullChecks) {
58178
+ switch (facts) {
58179
+ case 524288:
58180
+ return mapType(reduced, function (t) { return getTypeFacts(t) & 65536 ? getIntersectionType([t, getTypeFacts(t) & 131072 && !maybeTypeOfKind(reduced, 65536) ? getUnionType([emptyObjectType, nullType]) : emptyObjectType]) : t; });
58181
+ case 1048576:
58182
+ return mapType(reduced, function (t) { return getTypeFacts(t) & 131072 ? getIntersectionType([t, getTypeFacts(t) & 65536 && !maybeTypeOfKind(reduced, 32768) ? getUnionType([emptyObjectType, undefinedType]) : emptyObjectType]) : t; });
58183
+ case 2097152:
58184
+ case 4194304:
58185
+ return mapType(reduced, function (t) { return getTypeFacts(t) & 262144 ? getGlobalNonNullableTypeInstantiation(t) : t; });
58186
+ }
58187
+ }
58188
+ return reduced;
58189
+ }
58190
+ function recombineUnknownType(type) {
58191
+ return type === unknownUnionType ? unknownType : type;
58192
+ }
58141
58193
  function getTypeWithDefault(type, defaultExpression) {
58142
58194
  return defaultExpression ?
58143
58195
  getUnionType([getNonUndefinedType(type), getTypeOfExpression(defaultExpression)]) :
@@ -58378,8 +58430,8 @@ var ts;
58378
58430
  var types = origin && origin.flags & 1048576 ? origin.types : type.types;
58379
58431
  var mappedTypes;
58380
58432
  var changed = false;
58381
- for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
58382
- var t = types_17[_i];
58433
+ for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
58434
+ var t = types_16[_i];
58383
58435
  var mapped = t.flags & 1048576 ? mapType(t, mapper, noReductions) : mapper(t);
58384
58436
  changed || (changed = t !== mapped);
58385
58437
  if (mapped) {
@@ -58452,8 +58504,8 @@ var ts;
58452
58504
  }
58453
58505
  function isEvolvingArrayTypeList(types) {
58454
58506
  var hasEvolvingArrayType = false;
58455
- for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
58456
- var t = types_18[_i];
58507
+ for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
58508
+ var t = types_17[_i];
58457
58509
  if (!(t.flags & 131072)) {
58458
58510
  if (!(ts.getObjectFlags(t) & 256)) {
58459
58511
  return false;
@@ -59078,7 +59130,7 @@ var ts;
59078
59130
  if (isEvolvingArrayTypeList(types)) {
59079
59131
  return getEvolvingArrayType(getUnionType(ts.map(types, getElementTypeOfEvolvingArrayType)));
59080
59132
  }
59081
- var result = getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction);
59133
+ var result = recombineUnknownType(getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction));
59082
59134
  if (result !== declaredType && result.flags & declaredType.flags & 1048576 && ts.arraysEqual(result.types, declaredType.types)) {
59083
59135
  return declaredType;
59084
59136
  }
@@ -59174,11 +59226,10 @@ var ts;
59174
59226
  }
59175
59227
  function narrowTypeByTruthiness(type, expr, assumeTrue) {
59176
59228
  if (isMatchingReference(reference, expr)) {
59177
- return type.flags & 2 && assumeTrue ? nonNullUnknownType :
59178
- getTypeWithFacts(type, assumeTrue ? 4194304 : 8388608);
59229
+ return getAdjustedTypeWithFacts(type, assumeTrue ? 4194304 : 8388608);
59179
59230
  }
59180
59231
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
59181
- type = getTypeWithFacts(type, 2097152);
59232
+ type = getAdjustedTypeWithFacts(type, 2097152);
59182
59233
  }
59183
59234
  var access = getDiscriminantPropertyAccess(expr, type);
59184
59235
  if (access) {
@@ -59305,7 +59356,7 @@ var ts;
59305
59356
  var valueType = getTypeOfExpression(value);
59306
59357
  var removeNullable = equalsOperator !== assumeTrue && everyType(valueType, function (t) { return !!(t.flags & nullableFlags); }) ||
59307
59358
  equalsOperator === assumeTrue && everyType(valueType, function (t) { return !(t.flags & (3 | nullableFlags)); });
59308
- return removeNullable ? getTypeWithFacts(type, 2097152) : type;
59359
+ return removeNullable ? getAdjustedTypeWithFacts(type, 2097152) : type;
59309
59360
  }
59310
59361
  function narrowTypeByEquality(type, operator, value, assumeTrue) {
59311
59362
  if (type.flags & 1) {
@@ -59315,9 +59366,6 @@ var ts;
59315
59366
  assumeTrue = !assumeTrue;
59316
59367
  }
59317
59368
  var valueType = getTypeOfExpression(value);
59318
- if (assumeTrue && (type.flags & 2) && (operator === 34 || operator === 35) && (valueType.flags & 65536)) {
59319
- return getUnionType([nullType, undefinedType]);
59320
- }
59321
59369
  if ((type.flags & 2) && assumeTrue && (operator === 36 || operator === 37)) {
59322
59370
  if (valueType.flags & (131068 | 67108864)) {
59323
59371
  return valueType;
@@ -59337,7 +59385,7 @@ var ts;
59337
59385
  valueType.flags & 65536 ?
59338
59386
  assumeTrue ? 131072 : 1048576 :
59339
59387
  assumeTrue ? 65536 : 524288;
59340
- return type.flags & 2 && facts & (1048576 | 2097152) ? nonNullUnknownType : getTypeWithFacts(type, facts);
59388
+ return getAdjustedTypeWithFacts(type, facts);
59341
59389
  }
59342
59390
  if (assumeTrue) {
59343
59391
  var filterFn = operator === 34 ?
@@ -59357,21 +59405,18 @@ var ts;
59357
59405
  var target = getReferenceCandidate(typeOfExpr.expression);
59358
59406
  if (!isMatchingReference(reference, target)) {
59359
59407
  if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
59360
- return getTypeWithFacts(type, 2097152);
59408
+ return getAdjustedTypeWithFacts(type, 2097152);
59361
59409
  }
59362
59410
  return type;
59363
59411
  }
59364
59412
  if (type.flags & 1 && literal.text === "function") {
59365
59413
  return type;
59366
59414
  }
59367
- if (assumeTrue && type.flags & 2 && literal.text === "object") {
59368
- return type === nonNullUnknownType ? nonPrimitiveType : getUnionType([nonPrimitiveType, nullType]);
59369
- }
59370
59415
  var facts = assumeTrue ?
59371
59416
  typeofEQFacts.get(literal.text) || 128 :
59372
59417
  typeofNEFacts.get(literal.text) || 32768;
59373
59418
  var impliedType = getImpliedTypeFromTypeofGuard(type, literal.text);
59374
- return getTypeWithFacts(assumeTrue && impliedType ? mapType(type, narrowUnionMemberByTypeof(impliedType)) : type, facts);
59419
+ return getTypeWithFacts(assumeTrue && impliedType ? narrowTypeByImpliedType(type, impliedType) : type, facts);
59375
59420
  }
59376
59421
  function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
59377
59422
  var everyClauseChecks = clauseStart !== clauseEnd && ts.every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
@@ -59416,30 +59461,35 @@ var ts;
59416
59461
  }
59417
59462
  function getImpliedTypeFromTypeofGuard(type, text) {
59418
59463
  switch (text) {
59464
+ case "object":
59465
+ return type.flags & 1 ? type : getUnionType([nullType, nonPrimitiveType]);
59419
59466
  case "function":
59420
59467
  return type.flags & 1 ? type : globalFunctionType;
59421
- case "object":
59422
- return type.flags & 2 ? getUnionType([nonPrimitiveType, nullType]) : type;
59423
59468
  default:
59424
59469
  return typeofTypesByName.get(text);
59425
59470
  }
59426
59471
  }
59427
- function narrowUnionMemberByTypeof(candidate) {
59428
- return function (type) {
59429
- if (isTypeSubtypeOf(type, candidate)) {
59430
- return type;
59431
- }
59432
- if (isTypeSubtypeOf(candidate, type)) {
59433
- return candidate;
59472
+ function narrowTypeByImpliedType(type, candidate) {
59473
+ if (type.flags & 3) {
59474
+ return candidate;
59475
+ }
59476
+ return mapType(type, function (t) {
59477
+ if (isTypeRelatedTo(t, candidate, strictSubtypeRelation)) {
59478
+ return t;
59434
59479
  }
59435
- if (type.flags & 465829888) {
59436
- var constraint = getBaseConstraintOfType(type) || anyType;
59437
- if (isTypeSubtypeOf(candidate, constraint)) {
59438
- return getIntersectionType([type, candidate]);
59480
+ return mapType(candidate, function (c) {
59481
+ if (!areTypesComparable(t, c)) {
59482
+ return neverType;
59439
59483
  }
59440
- }
59441
- return type;
59442
- };
59484
+ if (c.flags & 131068 && t.flags & 524288 && !isEmptyAnonymousObjectType(t)) {
59485
+ return isTypeSubtypeOf(c, t) ? c : neverType;
59486
+ }
59487
+ if (c === globalFunctionType && isTypeSubtypeOf(c, t)) {
59488
+ return c;
59489
+ }
59490
+ return getIntersectionType([t, c]);
59491
+ });
59492
+ });
59443
59493
  }
59444
59494
  function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) {
59445
59495
  var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement, true);
@@ -59465,7 +59515,7 @@ var ts;
59465
59515
  return filterType(type, function (t) { return (getTypeFacts(t) & switchFacts) === switchFacts; });
59466
59516
  }
59467
59517
  var impliedType = getTypeWithFacts(getUnionType(clauseWitnesses.map(function (text) { return getImpliedTypeFromTypeofGuard(type, text) || type; })), switchFacts);
59468
- return getTypeWithFacts(mapType(type, narrowUnionMemberByTypeof(impliedType)), switchFacts);
59518
+ return getTypeWithFacts(narrowTypeByImpliedType(type, impliedType), switchFacts);
59469
59519
  }
59470
59520
  function isMatchingConstructorReference(expr) {
59471
59521
  return (ts.isPropertyAccessExpression(expr) && ts.idText(expr.name) === "constructor" ||
@@ -59505,7 +59555,7 @@ var ts;
59505
59555
  var left = getReferenceCandidate(expr.left);
59506
59556
  if (!isMatchingReference(reference, left)) {
59507
59557
  if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {
59508
- return getTypeWithFacts(type, 2097152);
59558
+ return getAdjustedTypeWithFacts(type, 2097152);
59509
59559
  }
59510
59560
  return type;
59511
59561
  }
@@ -59581,7 +59631,7 @@ var ts;
59581
59631
  }
59582
59632
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) &&
59583
59633
  !(getTypeFacts(predicate.type) & 65536)) {
59584
- type = getTypeWithFacts(type, 2097152);
59634
+ type = getAdjustedTypeWithFacts(type, 2097152);
59585
59635
  }
59586
59636
  var access = getDiscriminantPropertyAccess(predicateArgument, type);
59587
59637
  if (access) {
@@ -59632,7 +59682,7 @@ var ts;
59632
59682
  }
59633
59683
  function narrowTypeByOptionality(type, expr, assumePresent) {
59634
59684
  if (isMatchingReference(reference, expr)) {
59635
- return getTypeWithFacts(type, assumePresent ? 2097152 : 262144);
59685
+ return getAdjustedTypeWithFacts(type, assumePresent ? 2097152 : 262144);
59636
59686
  }
59637
59687
  var access = getDiscriminantPropertyAccess(expr, type);
59638
59688
  if (access) {
@@ -59707,8 +59757,8 @@ var ts;
59707
59757
  var annotationIncludesUndefined = strictNullChecks &&
59708
59758
  declaration.kind === 164 &&
59709
59759
  declaration.initializer &&
59710
- getFalsyFlags(declaredType) & 32768 &&
59711
- !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768);
59760
+ getTypeFacts(declaredType) & 16777216 &&
59761
+ !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216);
59712
59762
  popTypeResolution();
59713
59763
  return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288) : declaredType;
59714
59764
  }
@@ -59726,7 +59776,9 @@ var ts;
59726
59776
  !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
59727
59777
  }
59728
59778
  function isGenericTypeWithUnionConstraint(type) {
59729
- return !!(type.flags & 465829888 && getBaseConstraintOrType(type).flags & (98304 | 1048576));
59779
+ return type.flags & 2097152 ?
59780
+ ts.some(type.types, isGenericTypeWithUnionConstraint) :
59781
+ !!(type.flags & 465829888 && getBaseConstraintOrType(type).flags & (98304 | 1048576));
59730
59782
  }
59731
59783
  function isGenericTypeWithoutNullableConstraint(type) {
59732
59784
  return !!(type.flags & 465829888 && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304));
@@ -59743,7 +59795,7 @@ var ts;
59743
59795
  var substituteConstraints = !(checkMode && checkMode & 2) &&
59744
59796
  someType(type, isGenericTypeWithUnionConstraint) &&
59745
59797
  (isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
59746
- return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 ? getBaseConstraintOrType(t) : t; }) : type;
59798
+ return substituteConstraints ? mapType(type, getBaseConstraintOrType) : type;
59747
59799
  }
59748
59800
  function isExportOrExportExpression(location) {
59749
59801
  return !!ts.findAncestor(location, function (n) {
@@ -59946,7 +59998,7 @@ var ts;
59946
59998
  return convertAutoToAny(flowType);
59947
59999
  }
59948
60000
  }
59949
- else if (!assumeInitialized && !(getFalsyFlags(type) & 32768) && getFalsyFlags(flowType) & 32768) {
60001
+ else if (!assumeInitialized && !(getTypeFacts(type) & 16777216) && getTypeFacts(flowType) & 16777216) {
59950
60002
  error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
59951
60003
  return type;
59952
60004
  }
@@ -61224,8 +61276,8 @@ var ts;
61224
61276
  }
61225
61277
  var signatureList;
61226
61278
  var types = type.types;
61227
- for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
61228
- var current = types_19[_i];
61279
+ for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
61280
+ var current = types_18[_i];
61229
61281
  var signature = getContextualCallSignature(current, node);
61230
61282
  if (signature) {
61231
61283
  if (!signatureList) {
@@ -62188,19 +62240,19 @@ var ts;
62188
62240
  return checkNonNullType(checkExpression(node), node);
62189
62241
  }
62190
62242
  function isNullableType(type) {
62191
- return !!((strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304);
62243
+ return !!(getTypeFacts(type) & 50331648);
62192
62244
  }
62193
62245
  function getNonNullableTypeIfNeeded(type) {
62194
62246
  return isNullableType(type) ? getNonNullableType(type) : type;
62195
62247
  }
62196
- function reportObjectPossiblyNullOrUndefinedError(node, flags) {
62197
- error(node, flags & 32768 ? flags & 65536 ?
62248
+ function reportObjectPossiblyNullOrUndefinedError(node, facts) {
62249
+ error(node, facts & 16777216 ? facts & 33554432 ?
62198
62250
  ts.Diagnostics.Object_is_possibly_null_or_undefined :
62199
62251
  ts.Diagnostics.Object_is_possibly_undefined :
62200
62252
  ts.Diagnostics.Object_is_possibly_null);
62201
62253
  }
62202
- function reportCannotInvokePossiblyNullOrUndefinedError(node, flags) {
62203
- error(node, flags & 32768 ? flags & 65536 ?
62254
+ function reportCannotInvokePossiblyNullOrUndefinedError(node, facts) {
62255
+ error(node, facts & 16777216 ? facts & 33554432 ?
62204
62256
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined :
62205
62257
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined :
62206
62258
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);
@@ -62210,9 +62262,9 @@ var ts;
62210
62262
  error(node, ts.Diagnostics.Object_is_of_type_unknown);
62211
62263
  return errorType;
62212
62264
  }
62213
- var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304;
62214
- if (kind) {
62215
- reportError(node, kind);
62265
+ var facts = getTypeFacts(type);
62266
+ if (facts & 50331648) {
62267
+ reportError(node, facts);
62216
62268
  var t = getNonNullableType(type);
62217
62269
  return t.flags & (98304 | 131072) ? errorType : t;
62218
62270
  }
@@ -62478,7 +62530,7 @@ var ts;
62478
62530
  assumeUninitialized = true;
62479
62531
  }
62480
62532
  var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
62481
- if (assumeUninitialized && !(getFalsyFlags(propType) & 32768) && getFalsyFlags(flowType) & 32768) {
62533
+ if (assumeUninitialized && !(getTypeFacts(propType) & 16777216) && getTypeFacts(flowType) & 16777216) {
62482
62534
  error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop));
62483
62535
  return propType;
62484
62536
  }
@@ -64082,8 +64134,8 @@ var ts;
64082
64134
  if (apparentType.flags & 1048576) {
64083
64135
  var types = apparentType.types;
64084
64136
  var hasSignatures = false;
64085
- for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
64086
- var constituent = types_20[_i];
64137
+ for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
64138
+ var constituent = types_19[_i];
64087
64139
  var signatures = getSignaturesOfType(constituent, kind);
64088
64140
  if (signatures.length !== 0) {
64089
64141
  hasSignatures = true;
@@ -65591,7 +65643,7 @@ var ts;
65591
65643
  var type = getTypeOfSymbol(symbol);
65592
65644
  if (strictNullChecks &&
65593
65645
  !(type.flags & (3 | 131072)) &&
65594
- !(exactOptionalPropertyTypes ? symbol.flags & 16777216 : getFalsyFlags(type) & 32768)) {
65646
+ !(exactOptionalPropertyTypes ? symbol.flags & 16777216 : getTypeFacts(type) & 16777216)) {
65595
65647
  error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
65596
65648
  }
65597
65649
  }
@@ -65750,8 +65802,8 @@ var ts;
65750
65802
  }
65751
65803
  if (type.flags & 3145728) {
65752
65804
  var types = type.types;
65753
- for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
65754
- var t = types_21[_i];
65805
+ for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
65806
+ var t = types_20[_i];
65755
65807
  if (maybeTypeOfKind(t, kind)) {
65756
65808
  return true;
65757
65809
  }
@@ -65941,7 +65993,7 @@ var ts;
65941
65993
  var prop = exprOrAssignment;
65942
65994
  if (prop.objectAssignmentInitializer) {
65943
65995
  if (strictNullChecks &&
65944
- !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 32768)) {
65996
+ !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216)) {
65945
65997
  sourceType = getTypeWithFacts(sourceType, 524288);
65946
65998
  }
65947
65999
  checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
@@ -66306,7 +66358,7 @@ var ts;
66306
66358
  case 56:
66307
66359
  case 75: {
66308
66360
  var resultType_3 = getTypeFacts(leftType) & 8388608 ?
66309
- getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2) :
66361
+ getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2) :
66310
66362
  leftType;
66311
66363
  if (operator === 75) {
66312
66364
  checkAssignmentOperator(rightType);
@@ -68468,8 +68520,8 @@ var ts;
68468
68520
  }
68469
68521
  function getEntityNameForDecoratorMetadataFromTypeList(types) {
68470
68522
  var commonEntityName;
68471
- for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
68472
- var typeNode = types_22[_i];
68523
+ for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
68524
+ var typeNode = types_21[_i];
68473
68525
  while (typeNode.kind === 191 || typeNode.kind === 197) {
68474
68526
  typeNode = typeNode.type;
68475
68527
  }
@@ -69219,7 +69271,7 @@ var ts;
69219
69271
  }
69220
69272
  if (ts.isBindingPattern(node.name)) {
69221
69273
  var needCheckInitializer = node.initializer && node.parent.parent.kind !== 243;
69222
- var needCheckWidenedType = node.name.elements.length === 0;
69274
+ var needCheckWidenedType = !ts.some(node.name.elements, ts.not(ts.isOmittedExpression));
69223
69275
  if (needCheckInitializer || needCheckWidenedType) {
69224
69276
  var widenedType = getWidenedTypeForVariableLikeDeclaration(node);
69225
69277
  if (needCheckInitializer) {
@@ -69360,7 +69412,7 @@ var ts;
69360
69412
  return;
69361
69413
  var type = checkTruthinessExpression(location);
69362
69414
  var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
69363
- if (getFalsyFlags(type) || isPropertyExpressionCast)
69415
+ if (!(getTypeFacts(type) & 4194304) || isPropertyExpressionCast)
69364
69416
  return;
69365
69417
  var callSignatures = getSignaturesOfType(type, 0);
69366
69418
  var isPromise = !!getAwaitedTypeOfPromise(type);
@@ -70714,17 +70766,16 @@ var ts;
70714
70766
  });
70715
70767
  }
70716
70768
  function checkKindsOfPropertyMemberOverrides(type, baseType) {
70717
- var _a, _b;
70769
+ var _a, _b, _c, _d;
70718
70770
  var baseProperties = getPropertiesOfType(baseType);
70719
- basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
70720
- var baseProperty = baseProperties_1[_i];
70771
+ var _loop_33 = function (baseProperty) {
70721
70772
  var base = getTargetSymbol(baseProperty);
70722
70773
  if (base.flags & 4194304) {
70723
- continue;
70774
+ return "continue";
70724
70775
  }
70725
70776
  var baseSymbol = getPropertyOfObjectType(type, base.escapedName);
70726
70777
  if (!baseSymbol) {
70727
- continue;
70778
+ return "continue";
70728
70779
  }
70729
70780
  var derived = getTargetSymbol(baseSymbol);
70730
70781
  var baseDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(base);
@@ -70732,14 +70783,14 @@ var ts;
70732
70783
  if (derived === base) {
70733
70784
  var derivedClassDecl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
70734
70785
  if (baseDeclarationFlags & 128 && (!derivedClassDecl || !ts.hasSyntacticModifier(derivedClassDecl, 128))) {
70735
- for (var _c = 0, _d = getBaseTypes(type); _c < _d.length; _c++) {
70736
- var otherBaseType = _d[_c];
70786
+ for (var _e = 0, _f = getBaseTypes(type); _e < _f.length; _e++) {
70787
+ var otherBaseType = _f[_e];
70737
70788
  if (otherBaseType === baseType)
70738
70789
  continue;
70739
70790
  var baseSymbol_1 = getPropertyOfObjectType(otherBaseType, base.escapedName);
70740
70791
  var derivedElsewhere = baseSymbol_1 && getTargetSymbol(baseSymbol_1);
70741
70792
  if (derivedElsewhere && derivedElsewhere !== base) {
70742
- continue basePropertyCheck;
70793
+ return "continue-basePropertyCheck";
70743
70794
  }
70744
70795
  }
70745
70796
  if (derivedClassDecl.kind === 226) {
@@ -70753,16 +70804,18 @@ var ts;
70753
70804
  else {
70754
70805
  var derivedDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(derived);
70755
70806
  if (baseDeclarationFlags & 8 || derivedDeclarationFlags & 8) {
70756
- continue;
70807
+ return "continue";
70757
70808
  }
70758
70809
  var errorMessage = void 0;
70759
70810
  var basePropertyFlags = base.flags & 98308;
70760
70811
  var derivedPropertyFlags = derived.flags & 98308;
70761
70812
  if (basePropertyFlags && derivedPropertyFlags) {
70762
- if (baseDeclarationFlags & 128 && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer)
70763
- || base.valueDeclaration && base.valueDeclaration.parent.kind === 258
70813
+ if ((ts.getCheckFlags(base) & 6
70814
+ ? (_a = base.declarations) === null || _a === void 0 ? void 0 : _a.some(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); })
70815
+ : (_b = base.declarations) === null || _b === void 0 ? void 0 : _b.every(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); }))
70816
+ || ts.getCheckFlags(base) & 262144
70764
70817
  || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) {
70765
- continue;
70818
+ return "continue";
70766
70819
  }
70767
70820
  var overriddenInstanceProperty = basePropertyFlags !== 4 && derivedPropertyFlags === 4;
70768
70821
  var overriddenInstanceAccessor = basePropertyFlags === 4 && derivedPropertyFlags !== 4;
@@ -70773,12 +70826,12 @@ var ts;
70773
70826
  error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type));
70774
70827
  }
70775
70828
  else if (useDefineForClassFields) {
70776
- var uninitialized = (_a = derived.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return d.kind === 167 && !d.initializer; });
70829
+ var uninitialized = (_c = derived.declarations) === null || _c === void 0 ? void 0 : _c.find(function (d) { return d.kind === 167 && !d.initializer; });
70777
70830
  if (uninitialized
70778
70831
  && !(derived.flags & 33554432)
70779
70832
  && !(baseDeclarationFlags & 128)
70780
70833
  && !(derivedDeclarationFlags & 128)
70781
- && !((_b = derived.declarations) === null || _b === void 0 ? void 0 : _b.some(function (d) { return !!(d.flags & 16777216); }))) {
70834
+ && !((_d = derived.declarations) === null || _d === void 0 ? void 0 : _d.some(function (d) { return !!(d.flags & 16777216); }))) {
70782
70835
  var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));
70783
70836
  var propName = uninitialized.name;
70784
70837
  if (uninitialized.exclamationToken
@@ -70791,11 +70844,11 @@ var ts;
70791
70844
  }
70792
70845
  }
70793
70846
  }
70794
- continue;
70847
+ return "continue";
70795
70848
  }
70796
70849
  else if (isPrototypeProperty(base)) {
70797
70850
  if (isPrototypeProperty(derived) || derived.flags & 4) {
70798
- continue;
70851
+ return "continue";
70799
70852
  }
70800
70853
  else {
70801
70854
  ts.Debug.assert(!!(derived.flags & 98304));
@@ -70810,9 +70863,20 @@ var ts;
70810
70863
  }
70811
70864
  error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
70812
70865
  }
70866
+ };
70867
+ basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
70868
+ var baseProperty = baseProperties_1[_i];
70869
+ var state_10 = _loop_33(baseProperty);
70870
+ switch (state_10) {
70871
+ case "continue-basePropertyCheck": continue basePropertyCheck;
70872
+ }
70813
70873
  }
70814
70874
  }
70815
- function getNonInterhitedProperties(type, baseTypes, properties) {
70875
+ function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
70876
+ return baseDeclarationFlags & 128 && (!ts.isPropertyDeclaration(declaration) || !declaration.initializer)
70877
+ || ts.isInterfaceDeclaration(declaration.parent);
70878
+ }
70879
+ function getNonInheritedProperties(type, baseTypes, properties) {
70816
70880
  if (!ts.length(baseTypes)) {
70817
70881
  return properties;
70818
70882
  }
@@ -70881,7 +70945,7 @@ var ts;
70881
70945
  var propName = member.name;
70882
70946
  if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
70883
70947
  var type = getTypeOfSymbol(getSymbolOfNode(member));
70884
- if (!(type.flags & 3 || getFalsyFlags(type) & 32768)) {
70948
+ if (!(type.flags & 3 || getTypeFacts(type) & 16777216)) {
70885
70949
  if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
70886
70950
  error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));
70887
70951
  }
@@ -70905,7 +70969,7 @@ var ts;
70905
70969
  ts.setParent(reference, staticBlock);
70906
70970
  reference.flowNode = staticBlock.returnFlowNode;
70907
70971
  var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
70908
- if (!(getFalsyFlags(flowType) & 32768)) {
70972
+ if (!(getTypeFacts(flowType) & 16777216)) {
70909
70973
  return true;
70910
70974
  }
70911
70975
  }
@@ -70920,7 +70984,7 @@ var ts;
70920
70984
  ts.setParent(reference, constructor);
70921
70985
  reference.flowNode = constructor.returnFlowNode;
70922
70986
  var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
70923
- return !(getFalsyFlags(flowType) & 32768);
70987
+ return !(getTypeFacts(flowType) & 16777216);
70924
70988
  }
70925
70989
  function checkInterfaceDeclaration(node) {
70926
70990
  if (!checkGrammarDecoratorsAndModifiers(node))
@@ -77939,8 +78003,8 @@ var ts;
77939
78003
  }
77940
78004
  function serializeTypeList(types) {
77941
78005
  var serializedUnion;
77942
- for (var _i = 0, types_23 = types; _i < types_23.length; _i++) {
77943
- var typeNode = types_23[_i];
78006
+ for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
78007
+ var typeNode = types_22[_i];
77944
78008
  while (typeNode.kind === 191) {
77945
78009
  typeNode = typeNode.type;
77946
78010
  }
@@ -93598,8 +93662,8 @@ var ts;
93598
93662
  bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference", data: directive.fileName });
93599
93663
  writeLine();
93600
93664
  }
93601
- for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
93602
- var directive = types_24[_d];
93665
+ for (var _d = 0, types_23 = types; _d < types_23.length; _d++) {
93666
+ var directive = types_23[_d];
93603
93667
  var pos = writer.getTextPos();
93604
93668
  var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat)
93605
93669
  ? "resolution-mode=\"" + (directive.resolutionMode === ts.ModuleKind.ESNext ? "import" : "require") + "\""
@@ -101239,7 +101303,7 @@ var ts;
101239
101303
  importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
101240
101304
  });
101241
101305
  var sortedPaths = [];
101242
- var _loop_33 = function (directory) {
101306
+ var _loop_34 = function (directory) {
101243
101307
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
101244
101308
  var pathsInDirectory;
101245
101309
  allFileNames.forEach(function (_a, fileName) {
@@ -101263,9 +101327,9 @@ var ts;
101263
101327
  };
101264
101328
  var out_directory_1;
101265
101329
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
101266
- var state_10 = _loop_33(directory);
101330
+ var state_11 = _loop_34(directory);
101267
101331
  directory = out_directory_1;
101268
- if (state_10 === "break")
101332
+ if (state_11 === "break")
101269
101333
  break;
101270
101334
  }
101271
101335
  if (allFileNames.size) {