typescript 4.8.0-dev.20220530 → 4.8.0-dev.20220602

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-dev.20220530";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220602";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -6084,6 +6084,7 @@ var ts;
6084
6084
  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."),
6085
6085
  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."),
6086
6086
  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."),
6087
+ 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"),
6087
6088
  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}'."),
6088
6089
  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}'."),
6089
6090
  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}'."),
@@ -36114,8 +36115,7 @@ var ts;
36114
36115
  var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
36115
36116
  loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
36116
36117
  if (!pathAndExtension && packageInfo
36117
- && packageInfo.packageJsonContent.exports === undefined
36118
- && packageInfo.packageJsonContent.main === undefined
36118
+ && (packageInfo.packageJsonContent.exports === undefined || packageInfo.packageJsonContent.exports === null)
36119
36119
  && state.features & NodeResolutionFeatures.EsmMode) {
36120
36120
  pathAndExtension = loadModuleFromFile(extensions, ts.combinePaths(candidate, "index.js"), onlyRecordFailures, state);
36121
36121
  }
@@ -41039,7 +41039,12 @@ var ts;
41039
41039
  function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
41040
41040
  if (meaning & (111551 & ~1024)) {
41041
41041
  if (isPrimitiveTypeName(name)) {
41042
- error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
41042
+ if (isExtendedByInterface(errorLocation)) {
41043
+ 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));
41044
+ }
41045
+ else {
41046
+ error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
41047
+ }
41043
41048
  return true;
41044
41049
  }
41045
41050
  var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 & ~111551, undefined, undefined, false));
@@ -41059,6 +41064,16 @@ var ts;
41059
41064
  }
41060
41065
  return false;
41061
41066
  }
41067
+ function isExtendedByInterface(node) {
41068
+ var grandparent = node.parent.parent;
41069
+ var parentOfGrandparent = grandparent.parent;
41070
+ if (grandparent && parentOfGrandparent) {
41071
+ var isExtending = ts.isHeritageClause(grandparent) && grandparent.token === 94;
41072
+ var isInterface = ts.isInterfaceDeclaration(parentOfGrandparent);
41073
+ return isExtending && isInterface;
41074
+ }
41075
+ return false;
41076
+ }
41062
41077
  function maybeMappedType(node, symbol) {
41063
41078
  var container = ts.findAncestor(node.parent, function (n) {
41064
41079
  return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit";
@@ -43585,7 +43600,7 @@ var ts;
43585
43600
  anyType : getNonMissingTypeOfSymbol(propertySymbol);
43586
43601
  var saveEnclosingDeclaration = context.enclosingDeclaration;
43587
43602
  context.enclosingDeclaration = undefined;
43588
- if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 4096 && isLateBoundName(propertySymbol.escapedName)) {
43603
+ if (context.tracker.trackSymbol && isLateBoundName(propertySymbol.escapedName)) {
43589
43604
  if (propertySymbol.declarations) {
43590
43605
  var decl = ts.first(propertySymbol.declarations);
43591
43606
  if (hasLateBindableName(decl)) {
@@ -45040,7 +45055,7 @@ var ts;
45040
45055
  ? getBaseConstructorTypeOfClass(staticType)
45041
45056
  : anyType;
45042
45057
  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);
45043
- var symbolProps = getNonInterhitedProperties(classType, baseTypes, getPropertiesOfType(classType));
45058
+ var symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType));
45044
45059
  var publicSymbolProps = ts.filter(symbolProps, function (s) {
45045
45060
  var valueDecl = s.valueDeclaration;
45046
45061
  return !!valueDecl && !(ts.isNamedDeclaration(valueDecl) && ts.isPrivateIdentifier(valueDecl.name));
@@ -45954,7 +45969,7 @@ var ts;
45954
45969
  return type;
45955
45970
  }
45956
45971
  if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
45957
- return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration, 0)) & 32768) ? getNonUndefinedType(type) : type;
45972
+ return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer(declaration, 0)) & 16777216) ? getNonUndefinedType(type) : type;
45958
45973
  }
45959
45974
  return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0)], 2));
45960
45975
  }
@@ -48742,7 +48757,7 @@ var ts;
48742
48757
  var objectType;
48743
48758
  return !!(type.flags & 8388608 && ts.getObjectFlags(objectType = type.objectType) & 32 &&
48744
48759
  !isGenericMappedType(objectType) && isGenericIndexType(type.indexType) &&
48745
- !objectType.declaration.questionToken && !objectType.declaration.nameType);
48760
+ !(getMappedTypeModifiers(objectType) & 8) && !objectType.declaration.nameType);
48746
48761
  }
48747
48762
  function getApparentType(type) {
48748
48763
  var t = !(type.flags & 465829888) ? type : getBaseConstraintOfType(type) || unknownType;
@@ -53441,7 +53456,7 @@ var ts;
53441
53456
  var sourceSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
53442
53457
  var targetSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(targetType));
53443
53458
  var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) &&
53444
- (getFalsyFlags(sourceType) & 98304) === (getFalsyFlags(targetType) & 98304);
53459
+ (getTypeFacts(sourceType) & 50331648) === (getTypeFacts(targetType) & 50331648);
53445
53460
  var related = callbacks ?
53446
53461
  compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8) | (strictVariance ? 2 : 1), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) :
53447
53462
  !(checkMode & 3) && !strictVariance && compareTypes(sourceType, targetType, false) || compareTypes(targetType, sourceType, reportErrors);
@@ -56198,27 +56213,8 @@ var ts;
56198
56213
  var value = _a.value;
56199
56214
  return value.base10Value === "0";
56200
56215
  }
56201
- function getFalsyFlagsOfTypes(types) {
56202
- var result = 0;
56203
- for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
56204
- var t = types_14[_i];
56205
- result |= getFalsyFlags(t);
56206
- }
56207
- return result;
56208
- }
56209
- function getFalsyFlags(type) {
56210
- var t = type.flags & 2097152 ? getBaseConstraintOrType(type) : type;
56211
- return t.flags & 1048576 ? getFalsyFlagsOfTypes(t.types) :
56212
- t.flags & 128 ? t.value === "" ? 128 : 0 :
56213
- t.flags & 256 ? t.value === 0 ? 256 : 0 :
56214
- t.flags & 2048 ? isZeroBigInt(t) ? 2048 : 0 :
56215
- t.flags & 512 ? (t === falseType || t === regularFalseType) ? 512 : 0 :
56216
- t.flags & 117724;
56217
- }
56218
56216
  function removeDefinitelyFalsyTypes(type) {
56219
- return getFalsyFlags(type) & 117632 ?
56220
- filterType(type, function (t) { return !(getFalsyFlags(t) & 117632); }) :
56221
- type;
56217
+ return filterType(type, function (t) { return !!(getTypeFacts(t) & 4194304); });
56222
56218
  }
56223
56219
  function extractDefinitelyFalsyTypes(type) {
56224
56220
  return mapType(type, getDefinitelyFalsyPartOfType);
@@ -56256,11 +56252,7 @@ var ts;
56256
56252
  getIntersectionType([type, emptyObjectType]);
56257
56253
  }
56258
56254
  function getNonNullableType(type) {
56259
- if (strictNullChecks) {
56260
- var reducedType = getTypeWithFacts(type, 2097152);
56261
- return maybeTypeOfKind(reducedType, 465829888) ? getGlobalNonNullableTypeInstantiation(reducedType) : reducedType;
56262
- }
56263
- return type;
56255
+ return strictNullChecks ? getAdjustedTypeWithFacts(type, 2097152) : type;
56264
56256
  }
56265
56257
  function addOptionalTypeMarker(type) {
56266
56258
  return strictNullChecks ? getUnionType([type, optionalType]) : type;
@@ -57230,8 +57222,8 @@ var ts;
57230
57222
  }
57231
57223
  function getSingleTypeVariableFromIntersectionTypes(types) {
57232
57224
  var typeVariable;
57233
- for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
57234
- var type = types_15[_i];
57225
+ for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
57226
+ var type = types_14[_i];
57235
57227
  var t = type.flags & 2097152 && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); });
57236
57228
  if (!t || typeVariable && t !== typeVariable) {
57237
57229
  return undefined;
@@ -57891,8 +57883,8 @@ var ts;
57891
57883
  }
57892
57884
  }
57893
57885
  };
57894
- for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
57895
- var type = types_16[_i];
57886
+ for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
57887
+ var type = types_15[_i];
57896
57888
  var state_9 = _loop_24(type);
57897
57889
  if (typeof state_9 === "object")
57898
57890
  return state_9.value;
@@ -57991,14 +57983,16 @@ var ts;
57991
57983
  return !!(resolved.callSignatures.length || resolved.constructSignatures.length ||
57992
57984
  resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
57993
57985
  }
57994
- function getTypeFacts(type, ignoreObjects) {
57995
- if (ignoreObjects === void 0) { ignoreObjects = false; }
57986
+ function getTypeFacts(type) {
57987
+ if (type.flags & (2097152 | 465829888)) {
57988
+ type = getBaseConstraintOfType(type) || unknownType;
57989
+ }
57996
57990
  var flags = type.flags;
57997
- if (flags & 4) {
57991
+ if (flags & (4 | 268435456)) {
57998
57992
  return strictNullChecks ? 16317953 : 16776705;
57999
57993
  }
58000
- if (flags & 128) {
58001
- var isEmpty = type.value === "";
57994
+ if (flags & (128 | 134217728)) {
57995
+ var isEmpty = flags & 128 && type.value === "";
58002
57996
  return strictNullChecks ?
58003
57997
  isEmpty ? 12123649 : 7929345 :
58004
57998
  isEmpty ? 12582401 : 16776705;
@@ -58030,20 +58024,20 @@ var ts;
58030
58024
  (type === falseType || type === regularFalseType) ? 12580616 : 16774920;
58031
58025
  }
58032
58026
  if (flags & 524288) {
58033
- if (ignoreObjects) {
58034
- return 16768959;
58035
- }
58036
58027
  return ts.getObjectFlags(type) & 16 && isEmptyObjectType(type) ?
58037
- strictNullChecks ? 16318463 : 16777215 :
58028
+ strictNullChecks ? 83427327 : 83886079 :
58038
58029
  isFunctionObjectType(type) ?
58039
58030
  strictNullChecks ? 7880640 : 16728000 :
58040
58031
  strictNullChecks ? 7888800 : 16736160;
58041
58032
  }
58042
- if (flags & (16384 | 32768)) {
58033
+ if (flags & 16384) {
58043
58034
  return 9830144;
58044
58035
  }
58036
+ if (flags & 32768) {
58037
+ return 26607360;
58038
+ }
58045
58039
  if (flags & 65536) {
58046
- return 9363232;
58040
+ return 42917664;
58047
58041
  }
58048
58042
  if (flags & 12288) {
58049
58043
  return strictNullChecks ? 7925520 : 16772880;
@@ -58054,34 +58048,32 @@ var ts;
58054
58048
  if (flags & 131072) {
58055
58049
  return 0;
58056
58050
  }
58057
- if (flags & 465829888) {
58058
- return !isPatternLiteralType(type) ? getTypeFacts(getBaseConstraintOfType(type) || unknownType, ignoreObjects) :
58059
- strictNullChecks ? 7929345 : 16776705;
58060
- }
58061
58051
  if (flags & 1048576) {
58062
- return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t, ignoreObjects); }, 0);
58052
+ return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t); }, 0);
58063
58053
  }
58064
58054
  if (flags & 2097152) {
58065
- ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068));
58066
- return getIntersectionTypeFacts(type, ignoreObjects);
58055
+ return getIntersectionTypeFacts(type);
58067
58056
  }
58068
- return 16777215;
58057
+ return 83886079;
58069
58058
  }
58070
- function getIntersectionTypeFacts(type, ignoreObjects) {
58059
+ function getIntersectionTypeFacts(type) {
58060
+ var ignoreObjects = maybeTypeOfKind(type, 131068);
58071
58061
  var oredFacts = 0;
58072
- var andedFacts = 16777215;
58062
+ var andedFacts = 134217727;
58073
58063
  for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
58074
58064
  var t = _a[_i];
58075
- var f = getTypeFacts(t, ignoreObjects);
58076
- oredFacts |= f;
58077
- andedFacts &= f;
58065
+ if (!(ignoreObjects && t.flags & 524288)) {
58066
+ var f = getTypeFacts(t);
58067
+ oredFacts |= f;
58068
+ andedFacts &= f;
58069
+ }
58078
58070
  }
58079
- return oredFacts & 8256 | andedFacts & 16768959;
58071
+ return oredFacts & 8256 | andedFacts & 134209471;
58080
58072
  }
58081
58073
  function getTypeWithFacts(type, include) {
58082
58074
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
58083
58075
  }
58084
- function getIntersectionWithFacts(type, facts) {
58076
+ function getAdjustedTypeWithFacts(type, facts) {
58085
58077
  var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 ? unknownUnionType : type, facts));
58086
58078
  if (strictNullChecks) {
58087
58079
  switch (facts) {
@@ -58339,8 +58331,8 @@ var ts;
58339
58331
  var types = origin && origin.flags & 1048576 ? origin.types : type.types;
58340
58332
  var mappedTypes;
58341
58333
  var changed = false;
58342
- for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
58343
- var t = types_17[_i];
58334
+ for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
58335
+ var t = types_16[_i];
58344
58336
  var mapped = t.flags & 1048576 ? mapType(t, mapper, noReductions) : mapper(t);
58345
58337
  changed || (changed = t !== mapped);
58346
58338
  if (mapped) {
@@ -58413,8 +58405,8 @@ var ts;
58413
58405
  }
58414
58406
  function isEvolvingArrayTypeList(types) {
58415
58407
  var hasEvolvingArrayType = false;
58416
- for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
58417
- var t = types_18[_i];
58408
+ for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
58409
+ var t = types_17[_i];
58418
58410
  if (!(t.flags & 131072)) {
58419
58411
  if (!(ts.getObjectFlags(t) & 256)) {
58420
58412
  return false;
@@ -59135,10 +59127,10 @@ var ts;
59135
59127
  }
59136
59128
  function narrowTypeByTruthiness(type, expr, assumeTrue) {
59137
59129
  if (isMatchingReference(reference, expr)) {
59138
- return getIntersectionWithFacts(type, assumeTrue ? 4194304 : 8388608);
59130
+ return getAdjustedTypeWithFacts(type, assumeTrue ? 4194304 : 8388608);
59139
59131
  }
59140
59132
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
59141
- type = getTypeWithFacts(type, 2097152);
59133
+ type = getAdjustedTypeWithFacts(type, 2097152);
59142
59134
  }
59143
59135
  var access = getDiscriminantPropertyAccess(expr, type);
59144
59136
  if (access) {
@@ -59265,7 +59257,7 @@ var ts;
59265
59257
  var valueType = getTypeOfExpression(value);
59266
59258
  var removeNullable = equalsOperator !== assumeTrue && everyType(valueType, function (t) { return !!(t.flags & nullableFlags); }) ||
59267
59259
  equalsOperator === assumeTrue && everyType(valueType, function (t) { return !(t.flags & (3 | nullableFlags)); });
59268
- return removeNullable ? getTypeWithFacts(type, 2097152) : type;
59260
+ return removeNullable ? getAdjustedTypeWithFacts(type, 2097152) : type;
59269
59261
  }
59270
59262
  function narrowTypeByEquality(type, operator, value, assumeTrue) {
59271
59263
  if (type.flags & 1) {
@@ -59294,7 +59286,7 @@ var ts;
59294
59286
  valueType.flags & 65536 ?
59295
59287
  assumeTrue ? 131072 : 1048576 :
59296
59288
  assumeTrue ? 65536 : 524288;
59297
- return getIntersectionWithFacts(type, facts);
59289
+ return getAdjustedTypeWithFacts(type, facts);
59298
59290
  }
59299
59291
  if (assumeTrue) {
59300
59292
  var filterFn = operator === 34 ?
@@ -59314,7 +59306,7 @@ var ts;
59314
59306
  var target = getReferenceCandidate(typeOfExpr.expression);
59315
59307
  if (!isMatchingReference(reference, target)) {
59316
59308
  if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
59317
- return getTypeWithFacts(type, 2097152);
59309
+ return getAdjustedTypeWithFacts(type, 2097152);
59318
59310
  }
59319
59311
  return type;
59320
59312
  }
@@ -59464,7 +59456,7 @@ var ts;
59464
59456
  var left = getReferenceCandidate(expr.left);
59465
59457
  if (!isMatchingReference(reference, left)) {
59466
59458
  if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {
59467
- return getTypeWithFacts(type, 2097152);
59459
+ return getAdjustedTypeWithFacts(type, 2097152);
59468
59460
  }
59469
59461
  return type;
59470
59462
  }
@@ -59540,7 +59532,7 @@ var ts;
59540
59532
  }
59541
59533
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) &&
59542
59534
  !(getTypeFacts(predicate.type) & 65536)) {
59543
- type = getTypeWithFacts(type, 2097152);
59535
+ type = getAdjustedTypeWithFacts(type, 2097152);
59544
59536
  }
59545
59537
  var access = getDiscriminantPropertyAccess(predicateArgument, type);
59546
59538
  if (access) {
@@ -59591,7 +59583,7 @@ var ts;
59591
59583
  }
59592
59584
  function narrowTypeByOptionality(type, expr, assumePresent) {
59593
59585
  if (isMatchingReference(reference, expr)) {
59594
- return getTypeWithFacts(type, assumePresent ? 2097152 : 262144);
59586
+ return getAdjustedTypeWithFacts(type, assumePresent ? 2097152 : 262144);
59595
59587
  }
59596
59588
  var access = getDiscriminantPropertyAccess(expr, type);
59597
59589
  if (access) {
@@ -59666,8 +59658,8 @@ var ts;
59666
59658
  var annotationIncludesUndefined = strictNullChecks &&
59667
59659
  declaration.kind === 164 &&
59668
59660
  declaration.initializer &&
59669
- getFalsyFlags(declaredType) & 32768 &&
59670
- !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768);
59661
+ getTypeFacts(declaredType) & 16777216 &&
59662
+ !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216);
59671
59663
  popTypeResolution();
59672
59664
  return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288) : declaredType;
59673
59665
  }
@@ -59907,7 +59899,7 @@ var ts;
59907
59899
  return convertAutoToAny(flowType);
59908
59900
  }
59909
59901
  }
59910
- else if (!assumeInitialized && !(getFalsyFlags(type) & 32768) && getFalsyFlags(flowType) & 32768) {
59902
+ else if (!assumeInitialized && !(getTypeFacts(type) & 16777216) && getTypeFacts(flowType) & 16777216) {
59911
59903
  error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
59912
59904
  return type;
59913
59905
  }
@@ -61185,8 +61177,8 @@ var ts;
61185
61177
  }
61186
61178
  var signatureList;
61187
61179
  var types = type.types;
61188
- for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
61189
- var current = types_19[_i];
61180
+ for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
61181
+ var current = types_18[_i];
61190
61182
  var signature = getContextualCallSignature(current, node);
61191
61183
  if (signature) {
61192
61184
  if (!signatureList) {
@@ -62149,19 +62141,19 @@ var ts;
62149
62141
  return checkNonNullType(checkExpression(node), node);
62150
62142
  }
62151
62143
  function isNullableType(type) {
62152
- return !!((strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304);
62144
+ return !!(getTypeFacts(type) & 50331648);
62153
62145
  }
62154
62146
  function getNonNullableTypeIfNeeded(type) {
62155
62147
  return isNullableType(type) ? getNonNullableType(type) : type;
62156
62148
  }
62157
- function reportObjectPossiblyNullOrUndefinedError(node, flags) {
62158
- error(node, flags & 32768 ? flags & 65536 ?
62149
+ function reportObjectPossiblyNullOrUndefinedError(node, facts) {
62150
+ error(node, facts & 16777216 ? facts & 33554432 ?
62159
62151
  ts.Diagnostics.Object_is_possibly_null_or_undefined :
62160
62152
  ts.Diagnostics.Object_is_possibly_undefined :
62161
62153
  ts.Diagnostics.Object_is_possibly_null);
62162
62154
  }
62163
- function reportCannotInvokePossiblyNullOrUndefinedError(node, flags) {
62164
- error(node, flags & 32768 ? flags & 65536 ?
62155
+ function reportCannotInvokePossiblyNullOrUndefinedError(node, facts) {
62156
+ error(node, facts & 16777216 ? facts & 33554432 ?
62165
62157
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined :
62166
62158
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined :
62167
62159
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);
@@ -62171,9 +62163,9 @@ var ts;
62171
62163
  error(node, ts.Diagnostics.Object_is_of_type_unknown);
62172
62164
  return errorType;
62173
62165
  }
62174
- var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304;
62175
- if (kind) {
62176
- reportError(node, kind);
62166
+ var facts = getTypeFacts(type);
62167
+ if (facts & 50331648) {
62168
+ reportError(node, facts);
62177
62169
  var t = getNonNullableType(type);
62178
62170
  return t.flags & (98304 | 131072) ? errorType : t;
62179
62171
  }
@@ -62439,7 +62431,7 @@ var ts;
62439
62431
  assumeUninitialized = true;
62440
62432
  }
62441
62433
  var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
62442
- if (assumeUninitialized && !(getFalsyFlags(propType) & 32768) && getFalsyFlags(flowType) & 32768) {
62434
+ if (assumeUninitialized && !(getTypeFacts(propType) & 16777216) && getTypeFacts(flowType) & 16777216) {
62443
62435
  error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop));
62444
62436
  return propType;
62445
62437
  }
@@ -64043,8 +64035,8 @@ var ts;
64043
64035
  if (apparentType.flags & 1048576) {
64044
64036
  var types = apparentType.types;
64045
64037
  var hasSignatures = false;
64046
- for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
64047
- var constituent = types_20[_i];
64038
+ for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
64039
+ var constituent = types_19[_i];
64048
64040
  var signatures = getSignaturesOfType(constituent, kind);
64049
64041
  if (signatures.length !== 0) {
64050
64042
  hasSignatures = true;
@@ -65552,7 +65544,7 @@ var ts;
65552
65544
  var type = getTypeOfSymbol(symbol);
65553
65545
  if (strictNullChecks &&
65554
65546
  !(type.flags & (3 | 131072)) &&
65555
- !(exactOptionalPropertyTypes ? symbol.flags & 16777216 : getFalsyFlags(type) & 32768)) {
65547
+ !(exactOptionalPropertyTypes ? symbol.flags & 16777216 : getTypeFacts(type) & 16777216)) {
65556
65548
  error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
65557
65549
  }
65558
65550
  }
@@ -65711,8 +65703,8 @@ var ts;
65711
65703
  }
65712
65704
  if (type.flags & 3145728) {
65713
65705
  var types = type.types;
65714
- for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
65715
- var t = types_21[_i];
65706
+ for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
65707
+ var t = types_20[_i];
65716
65708
  if (maybeTypeOfKind(t, kind)) {
65717
65709
  return true;
65718
65710
  }
@@ -65902,7 +65894,7 @@ var ts;
65902
65894
  var prop = exprOrAssignment;
65903
65895
  if (prop.objectAssignmentInitializer) {
65904
65896
  if (strictNullChecks &&
65905
- !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 32768)) {
65897
+ !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216)) {
65906
65898
  sourceType = getTypeWithFacts(sourceType, 524288);
65907
65899
  }
65908
65900
  checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
@@ -65915,6 +65907,9 @@ var ts;
65915
65907
  if (target.kind === 221 && target.operatorToken.kind === 63) {
65916
65908
  checkBinaryExpression(target, checkMode);
65917
65909
  target = target.left;
65910
+ if (strictNullChecks) {
65911
+ sourceType = getTypeWithFacts(sourceType, 524288);
65912
+ }
65918
65913
  }
65919
65914
  if (target.kind === 205) {
65920
65915
  return checkObjectLiteralAssignment(target, sourceType, rightIsThis);
@@ -66267,7 +66262,7 @@ var ts;
66267
66262
  case 56:
66268
66263
  case 75: {
66269
66264
  var resultType_3 = getTypeFacts(leftType) & 8388608 ?
66270
- getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2) :
66265
+ getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2) :
66271
66266
  leftType;
66272
66267
  if (operator === 75) {
66273
66268
  checkAssignmentOperator(rightType);
@@ -68429,8 +68424,8 @@ var ts;
68429
68424
  }
68430
68425
  function getEntityNameForDecoratorMetadataFromTypeList(types) {
68431
68426
  var commonEntityName;
68432
- for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
68433
- var typeNode = types_22[_i];
68427
+ for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
68428
+ var typeNode = types_21[_i];
68434
68429
  while (typeNode.kind === 191 || typeNode.kind === 197) {
68435
68430
  typeNode = typeNode.type;
68436
68431
  }
@@ -69180,7 +69175,7 @@ var ts;
69180
69175
  }
69181
69176
  if (ts.isBindingPattern(node.name)) {
69182
69177
  var needCheckInitializer = node.initializer && node.parent.parent.kind !== 243;
69183
- var needCheckWidenedType = node.name.elements.length === 0;
69178
+ var needCheckWidenedType = !ts.some(node.name.elements, ts.not(ts.isOmittedExpression));
69184
69179
  if (needCheckInitializer || needCheckWidenedType) {
69185
69180
  var widenedType = getWidenedTypeForVariableLikeDeclaration(node);
69186
69181
  if (needCheckInitializer) {
@@ -69321,7 +69316,7 @@ var ts;
69321
69316
  return;
69322
69317
  var type = checkTruthinessExpression(location);
69323
69318
  var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
69324
- if (getFalsyFlags(type) || isPropertyExpressionCast)
69319
+ if (!(getTypeFacts(type) & 4194304) || isPropertyExpressionCast)
69325
69320
  return;
69326
69321
  var callSignatures = getSignaturesOfType(type, 0);
69327
69322
  var isPromise = !!getAwaitedTypeOfPromise(type);
@@ -70675,17 +70670,16 @@ var ts;
70675
70670
  });
70676
70671
  }
70677
70672
  function checkKindsOfPropertyMemberOverrides(type, baseType) {
70678
- var _a, _b;
70673
+ var _a, _b, _c, _d;
70679
70674
  var baseProperties = getPropertiesOfType(baseType);
70680
- basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
70681
- var baseProperty = baseProperties_1[_i];
70675
+ var _loop_33 = function (baseProperty) {
70682
70676
  var base = getTargetSymbol(baseProperty);
70683
70677
  if (base.flags & 4194304) {
70684
- continue;
70678
+ return "continue";
70685
70679
  }
70686
70680
  var baseSymbol = getPropertyOfObjectType(type, base.escapedName);
70687
70681
  if (!baseSymbol) {
70688
- continue;
70682
+ return "continue";
70689
70683
  }
70690
70684
  var derived = getTargetSymbol(baseSymbol);
70691
70685
  var baseDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(base);
@@ -70693,14 +70687,14 @@ var ts;
70693
70687
  if (derived === base) {
70694
70688
  var derivedClassDecl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
70695
70689
  if (baseDeclarationFlags & 128 && (!derivedClassDecl || !ts.hasSyntacticModifier(derivedClassDecl, 128))) {
70696
- for (var _c = 0, _d = getBaseTypes(type); _c < _d.length; _c++) {
70697
- var otherBaseType = _d[_c];
70690
+ for (var _e = 0, _f = getBaseTypes(type); _e < _f.length; _e++) {
70691
+ var otherBaseType = _f[_e];
70698
70692
  if (otherBaseType === baseType)
70699
70693
  continue;
70700
70694
  var baseSymbol_1 = getPropertyOfObjectType(otherBaseType, base.escapedName);
70701
70695
  var derivedElsewhere = baseSymbol_1 && getTargetSymbol(baseSymbol_1);
70702
70696
  if (derivedElsewhere && derivedElsewhere !== base) {
70703
- continue basePropertyCheck;
70697
+ return "continue-basePropertyCheck";
70704
70698
  }
70705
70699
  }
70706
70700
  if (derivedClassDecl.kind === 226) {
@@ -70714,16 +70708,18 @@ var ts;
70714
70708
  else {
70715
70709
  var derivedDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(derived);
70716
70710
  if (baseDeclarationFlags & 8 || derivedDeclarationFlags & 8) {
70717
- continue;
70711
+ return "continue";
70718
70712
  }
70719
70713
  var errorMessage = void 0;
70720
70714
  var basePropertyFlags = base.flags & 98308;
70721
70715
  var derivedPropertyFlags = derived.flags & 98308;
70722
70716
  if (basePropertyFlags && derivedPropertyFlags) {
70723
- if (baseDeclarationFlags & 128 && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer)
70724
- || base.valueDeclaration && base.valueDeclaration.parent.kind === 258
70717
+ if ((ts.getCheckFlags(base) & 6
70718
+ ? (_a = base.declarations) === null || _a === void 0 ? void 0 : _a.some(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); })
70719
+ : (_b = base.declarations) === null || _b === void 0 ? void 0 : _b.every(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); }))
70720
+ || ts.getCheckFlags(base) & 262144
70725
70721
  || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) {
70726
- continue;
70722
+ return "continue";
70727
70723
  }
70728
70724
  var overriddenInstanceProperty = basePropertyFlags !== 4 && derivedPropertyFlags === 4;
70729
70725
  var overriddenInstanceAccessor = basePropertyFlags === 4 && derivedPropertyFlags !== 4;
@@ -70734,12 +70730,12 @@ var ts;
70734
70730
  error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type));
70735
70731
  }
70736
70732
  else if (useDefineForClassFields) {
70737
- var uninitialized = (_a = derived.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return d.kind === 167 && !d.initializer; });
70733
+ var uninitialized = (_c = derived.declarations) === null || _c === void 0 ? void 0 : _c.find(function (d) { return d.kind === 167 && !d.initializer; });
70738
70734
  if (uninitialized
70739
70735
  && !(derived.flags & 33554432)
70740
70736
  && !(baseDeclarationFlags & 128)
70741
70737
  && !(derivedDeclarationFlags & 128)
70742
- && !((_b = derived.declarations) === null || _b === void 0 ? void 0 : _b.some(function (d) { return !!(d.flags & 16777216); }))) {
70738
+ && !((_d = derived.declarations) === null || _d === void 0 ? void 0 : _d.some(function (d) { return !!(d.flags & 16777216); }))) {
70743
70739
  var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));
70744
70740
  var propName = uninitialized.name;
70745
70741
  if (uninitialized.exclamationToken
@@ -70752,11 +70748,11 @@ var ts;
70752
70748
  }
70753
70749
  }
70754
70750
  }
70755
- continue;
70751
+ return "continue";
70756
70752
  }
70757
70753
  else if (isPrototypeProperty(base)) {
70758
70754
  if (isPrototypeProperty(derived) || derived.flags & 4) {
70759
- continue;
70755
+ return "continue";
70760
70756
  }
70761
70757
  else {
70762
70758
  ts.Debug.assert(!!(derived.flags & 98304));
@@ -70771,9 +70767,20 @@ var ts;
70771
70767
  }
70772
70768
  error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
70773
70769
  }
70770
+ };
70771
+ basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
70772
+ var baseProperty = baseProperties_1[_i];
70773
+ var state_10 = _loop_33(baseProperty);
70774
+ switch (state_10) {
70775
+ case "continue-basePropertyCheck": continue basePropertyCheck;
70776
+ }
70774
70777
  }
70775
70778
  }
70776
- function getNonInterhitedProperties(type, baseTypes, properties) {
70779
+ function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
70780
+ return baseDeclarationFlags & 128 && (!ts.isPropertyDeclaration(declaration) || !declaration.initializer)
70781
+ || ts.isInterfaceDeclaration(declaration.parent);
70782
+ }
70783
+ function getNonInheritedProperties(type, baseTypes, properties) {
70777
70784
  if (!ts.length(baseTypes)) {
70778
70785
  return properties;
70779
70786
  }
@@ -70842,7 +70849,7 @@ var ts;
70842
70849
  var propName = member.name;
70843
70850
  if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
70844
70851
  var type = getTypeOfSymbol(getSymbolOfNode(member));
70845
- if (!(type.flags & 3 || getFalsyFlags(type) & 32768)) {
70852
+ if (!(type.flags & 3 || getTypeFacts(type) & 16777216)) {
70846
70853
  if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
70847
70854
  error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));
70848
70855
  }
@@ -70866,7 +70873,7 @@ var ts;
70866
70873
  ts.setParent(reference, staticBlock);
70867
70874
  reference.flowNode = staticBlock.returnFlowNode;
70868
70875
  var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
70869
- if (!(getFalsyFlags(flowType) & 32768)) {
70876
+ if (!(getTypeFacts(flowType) & 16777216)) {
70870
70877
  return true;
70871
70878
  }
70872
70879
  }
@@ -70881,7 +70888,7 @@ var ts;
70881
70888
  ts.setParent(reference, constructor);
70882
70889
  reference.flowNode = constructor.returnFlowNode;
70883
70890
  var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
70884
- return !(getFalsyFlags(flowType) & 32768);
70891
+ return !(getTypeFacts(flowType) & 16777216);
70885
70892
  }
70886
70893
  function checkInterfaceDeclaration(node) {
70887
70894
  if (!checkGrammarDecoratorsAndModifiers(node))
@@ -77902,8 +77909,8 @@ var ts;
77902
77909
  }
77903
77910
  function serializeTypeList(types) {
77904
77911
  var serializedUnion;
77905
- for (var _i = 0, types_23 = types; _i < types_23.length; _i++) {
77906
- var typeNode = types_23[_i];
77912
+ for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
77913
+ var typeNode = types_22[_i];
77907
77914
  while (typeNode.kind === 191) {
77908
77915
  typeNode = typeNode.type;
77909
77916
  }
@@ -93528,8 +93535,8 @@ var ts;
93528
93535
  bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference", data: directive.fileName });
93529
93536
  writeLine();
93530
93537
  }
93531
- for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
93532
- var directive = types_24[_d];
93538
+ for (var _d = 0, types_23 = types; _d < types_23.length; _d++) {
93539
+ var directive = types_23[_d];
93533
93540
  var pos = writer.getTextPos();
93534
93541
  var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat)
93535
93542
  ? "resolution-mode=\"" + (directive.resolutionMode === ts.ModuleKind.ESNext ? "import" : "require") + "\""
@@ -101122,7 +101129,7 @@ var ts;
101122
101129
  importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
101123
101130
  });
101124
101131
  var sortedPaths = [];
101125
- var _loop_33 = function (directory) {
101132
+ var _loop_34 = function (directory) {
101126
101133
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
101127
101134
  var pathsInDirectory;
101128
101135
  allFileNames.forEach(function (_a, fileName) {
@@ -101146,9 +101153,9 @@ var ts;
101146
101153
  };
101147
101154
  var out_directory_1;
101148
101155
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
101149
- var state_10 = _loop_33(directory);
101156
+ var state_11 = _loop_34(directory);
101150
101157
  directory = out_directory_1;
101151
- if (state_10 === "break")
101158
+ if (state_11 === "break")
101152
101159
  break;
101153
101160
  }
101154
101161
  if (allFileNames.size) {