typescript 4.8.0-dev.20220529 → 4.8.0-dev.20220601

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/typescript.js CHANGED
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20220529";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20220601";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -9099,6 +9099,7 @@ var ts;
9099
9099
  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."),
9100
9100
  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."),
9101
9101
  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."),
9102
+ 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"),
9102
9103
  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}'."),
9103
9104
  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}'."),
9104
9105
  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}'."),
@@ -44368,8 +44369,8 @@ var ts;
44368
44369
  var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
44369
44370
  loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
44370
44371
  if (!pathAndExtension && packageInfo
44371
- && packageInfo.packageJsonContent.exports === undefined
44372
- && packageInfo.packageJsonContent.main === undefined
44372
+ // eslint-disable-next-line no-null/no-null
44373
+ && (packageInfo.packageJsonContent.exports === undefined || packageInfo.packageJsonContent.exports === null)
44373
44374
  && state.features & NodeResolutionFeatures.EsmMode) {
44374
44375
  // EsmMode disables index lookup in `loadNodeModuleFromDirectoryWorker` generally, however non-relative package resolutions still assume
44375
44376
  // a default `index.js` entrypoint if no `main` or `exports` are present
@@ -48034,7 +48035,10 @@ var ts;
48034
48035
  TypeFacts[TypeFacts["NEUndefinedOrNull"] = 2097152] = "NEUndefinedOrNull";
48035
48036
  TypeFacts[TypeFacts["Truthy"] = 4194304] = "Truthy";
48036
48037
  TypeFacts[TypeFacts["Falsy"] = 8388608] = "Falsy";
48037
- TypeFacts[TypeFacts["All"] = 16777215] = "All";
48038
+ TypeFacts[TypeFacts["IsUndefined"] = 16777216] = "IsUndefined";
48039
+ TypeFacts[TypeFacts["IsNull"] = 33554432] = "IsNull";
48040
+ TypeFacts[TypeFacts["IsUndefinedOrNull"] = 50331648] = "IsUndefinedOrNull";
48041
+ TypeFacts[TypeFacts["All"] = 134217727] = "All";
48038
48042
  // The following members encode facts about particular kinds of types for use in the getTypeFacts function.
48039
48043
  // The presence of a particular fact means that the given test is true for some (and possibly all) values
48040
48044
  // of that kind of type.
@@ -48076,14 +48080,16 @@ var ts;
48076
48080
  TypeFacts[TypeFacts["ObjectFacts"] = 16736160] = "ObjectFacts";
48077
48081
  TypeFacts[TypeFacts["FunctionStrictFacts"] = 7880640] = "FunctionStrictFacts";
48078
48082
  TypeFacts[TypeFacts["FunctionFacts"] = 16728000] = "FunctionFacts";
48079
- TypeFacts[TypeFacts["UndefinedFacts"] = 9830144] = "UndefinedFacts";
48080
- TypeFacts[TypeFacts["NullFacts"] = 9363232] = "NullFacts";
48081
- TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 16318463] = "EmptyObjectStrictFacts";
48083
+ TypeFacts[TypeFacts["VoidFacts"] = 9830144] = "VoidFacts";
48084
+ TypeFacts[TypeFacts["UndefinedFacts"] = 26607360] = "UndefinedFacts";
48085
+ TypeFacts[TypeFacts["NullFacts"] = 42917664] = "NullFacts";
48086
+ TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 83427327] = "EmptyObjectStrictFacts";
48087
+ TypeFacts[TypeFacts["EmptyObjectFacts"] = 83886079] = "EmptyObjectFacts";
48088
+ TypeFacts[TypeFacts["UnknownFacts"] = 83886079] = "UnknownFacts";
48082
48089
  TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
48083
- TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
48084
48090
  // Masks
48085
48091
  TypeFacts[TypeFacts["OrFactsMask"] = 8256] = "OrFactsMask";
48086
- TypeFacts[TypeFacts["AndFactsMask"] = 16768959] = "AndFactsMask";
48092
+ TypeFacts[TypeFacts["AndFactsMask"] = 134209471] = "AndFactsMask";
48087
48093
  })(TypeFacts || (TypeFacts = {}));
48088
48094
  var typeofEQFacts = new ts.Map(ts.getEntries({
48089
48095
  string: 1 /* TypeofEQString */,
@@ -50247,7 +50253,12 @@ var ts;
50247
50253
  function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
50248
50254
  if (meaning & (111551 /* Value */ & ~1024 /* NamespaceModule */)) {
50249
50255
  if (isPrimitiveTypeName(name)) {
50250
- error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
50256
+ if (isExtendedByInterface(errorLocation)) {
50257
+ 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));
50258
+ }
50259
+ else {
50260
+ error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name));
50261
+ }
50251
50262
  return true;
50252
50263
  }
50253
50264
  var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
@@ -50267,6 +50278,16 @@ var ts;
50267
50278
  }
50268
50279
  return false;
50269
50280
  }
50281
+ function isExtendedByInterface(node) {
50282
+ var grandparent = node.parent.parent;
50283
+ var parentOfGrandparent = grandparent.parent;
50284
+ if (grandparent && parentOfGrandparent) {
50285
+ var isExtending = ts.isHeritageClause(grandparent) && grandparent.token === 94 /* ExtendsKeyword */;
50286
+ var isInterface = ts.isInterfaceDeclaration(parentOfGrandparent);
50287
+ return isExtending && isInterface;
50288
+ }
50289
+ return false;
50290
+ }
50270
50291
  function maybeMappedType(node, symbol) {
50271
50292
  var container = ts.findAncestor(node.parent, function (n) {
50272
50293
  return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit";
@@ -53107,7 +53128,7 @@ var ts;
53107
53128
  anyType : getNonMissingTypeOfSymbol(propertySymbol);
53108
53129
  var saveEnclosingDeclaration = context.enclosingDeclaration;
53109
53130
  context.enclosingDeclaration = undefined;
53110
- if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 4096 /* Late */ && isLateBoundName(propertySymbol.escapedName)) {
53131
+ if (context.tracker.trackSymbol && isLateBoundName(propertySymbol.escapedName)) {
53111
53132
  if (propertySymbol.declarations) {
53112
53133
  var decl = ts.first(propertySymbol.declarations);
53113
53134
  if (hasLateBindableName(decl)) {
@@ -54791,7 +54812,7 @@ var ts;
54791
54812
  ? getBaseConstructorTypeOfClass(staticType)
54792
54813
  : anyType;
54793
54814
  var heritageClauses = __spreadArray(__spreadArray([], !ts.length(baseTypes) ? [] : [ts.factory.createHeritageClause(94 /* ExtendsKeyword */, ts.map(baseTypes, function (b) { return serializeBaseType(b, staticBaseType, localName); }))], true), !ts.length(implementsExpressions) ? [] : [ts.factory.createHeritageClause(117 /* ImplementsKeyword */, implementsExpressions)], true);
54794
- var symbolProps = getNonInterhitedProperties(classType, baseTypes, getPropertiesOfType(classType));
54815
+ var symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType));
54795
54816
  var publicSymbolProps = ts.filter(symbolProps, function (s) {
54796
54817
  // `valueDeclaration` could be undefined if inherited from
54797
54818
  // a union/intersection base type, but inherited properties
@@ -55929,7 +55950,7 @@ var ts;
55929
55950
  if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
55930
55951
  // In strict null checking mode, if a default value of a non-undefined type is specified, remove
55931
55952
  // undefined from the final type.
55932
- return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 32768 /* Undefined */) ? getNonUndefinedType(type) : type;
55953
+ return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 16777216 /* IsUndefined */) ? getNonUndefinedType(type) : type;
55933
55954
  }
55934
55955
  return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */));
55935
55956
  }
@@ -64424,7 +64445,7 @@ var ts;
64424
64445
  var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
64425
64446
  var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType));
64426
64447
  var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) &&
64427
- (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */);
64448
+ (getTypeFacts(sourceType) & 50331648 /* IsUndefinedOrNull */) === (getTypeFacts(targetType) & 50331648 /* IsUndefinedOrNull */);
64428
64449
  var related = callbacks ?
64429
64450
  compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) :
64430
64451
  !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors);
@@ -67642,30 +67663,8 @@ var ts;
67642
67663
  var value = _a.value;
67643
67664
  return value.base10Value === "0";
67644
67665
  }
67645
- function getFalsyFlagsOfTypes(types) {
67646
- var result = 0;
67647
- for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
67648
- var t = types_14[_i];
67649
- result |= getFalsyFlags(t);
67650
- }
67651
- return result;
67652
- }
67653
- // Returns the String, Number, Boolean, StringLiteral, NumberLiteral, BooleanLiteral, Void, Undefined, or Null
67654
- // flags for the string, number, boolean, "", 0, false, void, undefined, or null types respectively. Returns
67655
- // no flags for all other types (including non-falsy literal types).
67656
- function getFalsyFlags(type) {
67657
- var t = type.flags & 2097152 /* Intersection */ ? getBaseConstraintOrType(type) : type;
67658
- return t.flags & 1048576 /* Union */ ? getFalsyFlagsOfTypes(t.types) :
67659
- t.flags & 128 /* StringLiteral */ ? t.value === "" ? 128 /* StringLiteral */ : 0 :
67660
- t.flags & 256 /* NumberLiteral */ ? t.value === 0 ? 256 /* NumberLiteral */ : 0 :
67661
- t.flags & 2048 /* BigIntLiteral */ ? isZeroBigInt(t) ? 2048 /* BigIntLiteral */ : 0 :
67662
- t.flags & 512 /* BooleanLiteral */ ? (t === falseType || t === regularFalseType) ? 512 /* BooleanLiteral */ : 0 :
67663
- t.flags & 117724 /* PossiblyFalsy */;
67664
- }
67665
67666
  function removeDefinitelyFalsyTypes(type) {
67666
- return getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ ?
67667
- filterType(type, function (t) { return !(getFalsyFlags(t) & 117632 /* DefinitelyFalsy */); }) :
67668
- type;
67667
+ return filterType(type, function (t) { return !!(getTypeFacts(t) & 4194304 /* Truthy */); });
67669
67668
  }
67670
67669
  function extractDefinitelyFalsyTypes(type) {
67671
67670
  return mapType(type, getDefinitelyFalsyPartOfType);
@@ -67708,14 +67707,7 @@ var ts;
67708
67707
  getIntersectionType([type, emptyObjectType]);
67709
67708
  }
67710
67709
  function getNonNullableType(type) {
67711
- if (strictNullChecks) {
67712
- // First reduce away any constituents that are assignable to 'undefined' or 'null'. This not only eliminates
67713
- // 'undefined' and 'null', but also higher-order types such as a type parameter 'U extends undefined | null'
67714
- // that isn't eliminated by a NonNullable<T> instantiation.
67715
- var reducedType = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
67716
- return maybeTypeOfKind(reducedType, 465829888 /* Instantiable */) ? getGlobalNonNullableTypeInstantiation(reducedType) : reducedType;
67717
- }
67718
- return type;
67710
+ return strictNullChecks ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
67719
67711
  }
67720
67712
  function addOptionalTypeMarker(type) {
67721
67713
  return strictNullChecks ? getUnionType([type, optionalType]) : type;
@@ -68859,8 +68851,8 @@ var ts;
68859
68851
  }
68860
68852
  function getSingleTypeVariableFromIntersectionTypes(types) {
68861
68853
  var typeVariable;
68862
- for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
68863
- var type = types_15[_i];
68854
+ for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
68855
+ var type = types_14[_i];
68864
68856
  var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); });
68865
68857
  if (!t || typeVariable && t !== typeVariable) {
68866
68858
  return undefined;
@@ -69613,8 +69605,8 @@ var ts;
69613
69605
  }
69614
69606
  }
69615
69607
  };
69616
- for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
69617
- var type = types_16[_i];
69608
+ for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
69609
+ var type = types_15[_i];
69618
69610
  var state_9 = _loop_24(type);
69619
69611
  if (typeof state_9 === "object")
69620
69612
  return state_9.value;
@@ -69729,14 +69721,16 @@ var ts;
69729
69721
  return !!(resolved.callSignatures.length || resolved.constructSignatures.length ||
69730
69722
  resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
69731
69723
  }
69732
- function getTypeFacts(type, ignoreObjects) {
69733
- if (ignoreObjects === void 0) { ignoreObjects = false; }
69724
+ function getTypeFacts(type) {
69725
+ if (type.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */)) {
69726
+ type = getBaseConstraintOfType(type) || unknownType;
69727
+ }
69734
69728
  var flags = type.flags;
69735
- if (flags & 4 /* String */) {
69729
+ if (flags & (4 /* String */ | 268435456 /* StringMapping */)) {
69736
69730
  return strictNullChecks ? 16317953 /* StringStrictFacts */ : 16776705 /* StringFacts */;
69737
69731
  }
69738
- if (flags & 128 /* StringLiteral */) {
69739
- var isEmpty = type.value === "";
69732
+ if (flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */)) {
69733
+ var isEmpty = flags & 128 /* StringLiteral */ && type.value === "";
69740
69734
  return strictNullChecks ?
69741
69735
  isEmpty ? 12123649 /* EmptyStringStrictFacts */ : 7929345 /* NonEmptyStringStrictFacts */ :
69742
69736
  isEmpty ? 12582401 /* EmptyStringFacts */ : 16776705 /* NonEmptyStringFacts */;
@@ -69768,20 +69762,20 @@ var ts;
69768
69762
  (type === falseType || type === regularFalseType) ? 12580616 /* FalseFacts */ : 16774920 /* TrueFacts */;
69769
69763
  }
69770
69764
  if (flags & 524288 /* Object */) {
69771
- if (ignoreObjects) {
69772
- return 16768959 /* AndFactsMask */; // This is the identity element for computing type facts of intersection.
69773
- }
69774
69765
  return ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type) ?
69775
- strictNullChecks ? 16318463 /* EmptyObjectStrictFacts */ : 16777215 /* EmptyObjectFacts */ :
69766
+ strictNullChecks ? 83427327 /* EmptyObjectStrictFacts */ : 83886079 /* EmptyObjectFacts */ :
69776
69767
  isFunctionObjectType(type) ?
69777
69768
  strictNullChecks ? 7880640 /* FunctionStrictFacts */ : 16728000 /* FunctionFacts */ :
69778
69769
  strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */;
69779
69770
  }
69780
- if (flags & (16384 /* Void */ | 32768 /* Undefined */)) {
69781
- return 9830144 /* UndefinedFacts */;
69771
+ if (flags & 16384 /* Void */) {
69772
+ return 9830144 /* VoidFacts */;
69773
+ }
69774
+ if (flags & 32768 /* Undefined */) {
69775
+ return 26607360 /* UndefinedFacts */;
69782
69776
  }
69783
69777
  if (flags & 65536 /* Null */) {
69784
- return 9363232 /* NullFacts */;
69778
+ return 42917664 /* NullFacts */;
69785
69779
  }
69786
69780
  if (flags & 12288 /* ESSymbolLike */) {
69787
69781
  return strictNullChecks ? 7925520 /* SymbolStrictFacts */ : 16772880 /* SymbolFacts */;
@@ -69792,38 +69786,39 @@ var ts;
69792
69786
  if (flags & 131072 /* Never */) {
69793
69787
  return 0 /* None */;
69794
69788
  }
69795
- if (flags & 465829888 /* Instantiable */) {
69796
- return !isPatternLiteralType(type) ? getTypeFacts(getBaseConstraintOfType(type) || unknownType, ignoreObjects) :
69797
- strictNullChecks ? 7929345 /* NonEmptyStringStrictFacts */ : 16776705 /* NonEmptyStringFacts */;
69798
- }
69799
69789
  if (flags & 1048576 /* Union */) {
69800
- return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t, ignoreObjects); }, 0 /* None */);
69790
+ return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t); }, 0 /* None */);
69801
69791
  }
69802
69792
  if (flags & 2097152 /* Intersection */) {
69803
- // When an intersection contains a primitive type we ignore object type constituents as they are
69804
- // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
69805
- ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
69806
- return getIntersectionTypeFacts(type, ignoreObjects);
69793
+ return getIntersectionTypeFacts(type);
69807
69794
  }
69808
- return 16777215 /* All */;
69795
+ return 83886079 /* UnknownFacts */;
69809
69796
  }
69810
- function getIntersectionTypeFacts(type, ignoreObjects) {
69797
+ function getIntersectionTypeFacts(type) {
69798
+ // When an intersection contains a primitive type we ignore object type constituents as they are
69799
+ // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
69800
+ var ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */);
69811
69801
  // When computing the type facts of an intersection type, certain type facts are computed as `and`
69812
69802
  // and others are computed as `or`.
69813
69803
  var oredFacts = 0 /* None */;
69814
- var andedFacts = 16777215 /* All */;
69804
+ var andedFacts = 134217727 /* All */;
69815
69805
  for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
69816
69806
  var t = _a[_i];
69817
- var f = getTypeFacts(t, ignoreObjects);
69818
- oredFacts |= f;
69819
- andedFacts &= f;
69807
+ if (!(ignoreObjects && t.flags & 524288 /* Object */)) {
69808
+ var f = getTypeFacts(t);
69809
+ oredFacts |= f;
69810
+ andedFacts &= f;
69811
+ }
69820
69812
  }
69821
- return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 16768959 /* AndFactsMask */;
69813
+ return oredFacts & 8256 /* OrFactsMask */ | andedFacts & 134209471 /* AndFactsMask */;
69822
69814
  }
69823
69815
  function getTypeWithFacts(type, include) {
69824
69816
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
69825
69817
  }
69826
- function getIntersectionWithFacts(type, facts) {
69818
+ // This function is similar to getTypeWithFacts, except that in strictNullChecks mode it replaces type
69819
+ // unknown with the union {} | null | undefined (and reduces that accordingly), and it intersects remaining
69820
+ // instantiable types with {}, {} | null, or {} | undefined in order to remove null and/or undefined.
69821
+ function getAdjustedTypeWithFacts(type, facts) {
69827
69822
  var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 /* Unknown */ ? unknownUnionType : type, facts));
69828
69823
  if (strictNullChecks) {
69829
69824
  switch (facts) {
@@ -70089,8 +70084,8 @@ var ts;
70089
70084
  var types = origin && origin.flags & 1048576 /* Union */ ? origin.types : type.types;
70090
70085
  var mappedTypes;
70091
70086
  var changed = false;
70092
- for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
70093
- var t = types_17[_i];
70087
+ for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
70088
+ var t = types_16[_i];
70094
70089
  var mapped = t.flags & 1048576 /* Union */ ? mapType(t, mapper, noReductions) : mapper(t);
70095
70090
  changed || (changed = t !== mapped);
70096
70091
  if (mapped) {
@@ -70176,8 +70171,8 @@ var ts;
70176
70171
  }
70177
70172
  function isEvolvingArrayTypeList(types) {
70178
70173
  var hasEvolvingArrayType = false;
70179
- for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
70180
- var t = types_18[_i];
70174
+ for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
70175
+ var t = types_17[_i];
70181
70176
  if (!(t.flags & 131072 /* Never */)) {
70182
70177
  if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) {
70183
70178
  return false;
@@ -71000,10 +70995,10 @@ var ts;
71000
70995
  }
71001
70996
  function narrowTypeByTruthiness(type, expr, assumeTrue) {
71002
70997
  if (isMatchingReference(reference, expr)) {
71003
- return getIntersectionWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);
70998
+ return getAdjustedTypeWithFacts(type, assumeTrue ? 4194304 /* Truthy */ : 8388608 /* Falsy */);
71004
70999
  }
71005
71000
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
71006
- type = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71001
+ type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71007
71002
  }
71008
71003
  var access = getDiscriminantPropertyAccess(expr, type);
71009
71004
  if (access) {
@@ -71143,7 +71138,7 @@ var ts;
71143
71138
  // Note that we include any and unknown in the exclusion test because their domain includes null and undefined.
71144
71139
  var removeNullable = equalsOperator !== assumeTrue && everyType(valueType, function (t) { return !!(t.flags & nullableFlags); }) ||
71145
71140
  equalsOperator === assumeTrue && everyType(valueType, function (t) { return !(t.flags & (3 /* AnyOrUnknown */ | nullableFlags)); });
71146
- return removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
71141
+ return removeNullable ? getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type;
71147
71142
  }
71148
71143
  function narrowTypeByEquality(type, operator, value, assumeTrue) {
71149
71144
  if (type.flags & 1 /* Any */) {
@@ -71172,7 +71167,7 @@ var ts;
71172
71167
  valueType.flags & 65536 /* Null */ ?
71173
71168
  assumeTrue ? 131072 /* EQNull */ : 1048576 /* NENull */ :
71174
71169
  assumeTrue ? 65536 /* EQUndefined */ : 524288 /* NEUndefined */;
71175
- return getIntersectionWithFacts(type, facts);
71170
+ return getAdjustedTypeWithFacts(type, facts);
71176
71171
  }
71177
71172
  if (assumeTrue) {
71178
71173
  var filterFn = operator === 34 /* EqualsEqualsToken */ ?
@@ -71193,7 +71188,7 @@ var ts;
71193
71188
  var target = getReferenceCandidate(typeOfExpr.expression);
71194
71189
  if (!isMatchingReference(reference, target)) {
71195
71190
  if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
71196
- return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71191
+ return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71197
71192
  }
71198
71193
  return type;
71199
71194
  }
@@ -71397,7 +71392,7 @@ var ts;
71397
71392
  var left = getReferenceCandidate(expr.left);
71398
71393
  if (!isMatchingReference(reference, left)) {
71399
71394
  if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {
71400
- return getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71395
+ return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71401
71396
  }
71402
71397
  return type;
71403
71398
  }
@@ -71485,7 +71480,7 @@ var ts;
71485
71480
  }
71486
71481
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) &&
71487
71482
  !(getTypeFacts(predicate.type) & 65536 /* EQUndefined */)) {
71488
- type = getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71483
+ type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
71489
71484
  }
71490
71485
  var access = getDiscriminantPropertyAccess(predicateArgument, type);
71491
71486
  if (access) {
@@ -71542,7 +71537,7 @@ var ts;
71542
71537
  }
71543
71538
  function narrowTypeByOptionality(type, expr, assumePresent) {
71544
71539
  if (isMatchingReference(reference, expr)) {
71545
- return getTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */);
71540
+ return getAdjustedTypeWithFacts(type, assumePresent ? 2097152 /* NEUndefinedOrNull */ : 262144 /* EQUndefinedOrNull */);
71546
71541
  }
71547
71542
  var access = getDiscriminantPropertyAccess(expr, type);
71548
71543
  if (access) {
@@ -71628,8 +71623,8 @@ var ts;
71628
71623
  var annotationIncludesUndefined = strictNullChecks &&
71629
71624
  declaration.kind === 164 /* Parameter */ &&
71630
71625
  declaration.initializer &&
71631
- getFalsyFlags(declaredType) & 32768 /* Undefined */ &&
71632
- !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */);
71626
+ getTypeFacts(declaredType) & 16777216 /* IsUndefined */ &&
71627
+ !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216 /* IsUndefined */);
71633
71628
  popTypeResolution();
71634
71629
  return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288 /* NEUndefined */) : declaredType;
71635
71630
  }
@@ -71957,7 +71952,7 @@ var ts;
71957
71952
  return convertAutoToAny(flowType);
71958
71953
  }
71959
71954
  }
71960
- else if (!assumeInitialized && !(getFalsyFlags(type) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {
71955
+ else if (!assumeInitialized && !(getTypeFacts(type) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
71961
71956
  error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
71962
71957
  // Return the declared type to reduce follow-on errors
71963
71958
  return type;
@@ -73486,8 +73481,8 @@ var ts;
73486
73481
  }
73487
73482
  var signatureList;
73488
73483
  var types = type.types;
73489
- for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
73490
- var current = types_19[_i];
73484
+ for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
73485
+ var current = types_18[_i];
73491
73486
  var signature = getContextualCallSignature(current, node);
73492
73487
  if (signature) {
73493
73488
  if (!signatureList) {
@@ -74649,19 +74644,19 @@ var ts;
74649
74644
  return checkNonNullType(checkExpression(node), node);
74650
74645
  }
74651
74646
  function isNullableType(type) {
74652
- return !!((strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304 /* Nullable */);
74647
+ return !!(getTypeFacts(type) & 50331648 /* IsUndefinedOrNull */);
74653
74648
  }
74654
74649
  function getNonNullableTypeIfNeeded(type) {
74655
74650
  return isNullableType(type) ? getNonNullableType(type) : type;
74656
74651
  }
74657
- function reportObjectPossiblyNullOrUndefinedError(node, flags) {
74658
- error(node, flags & 32768 /* Undefined */ ? flags & 65536 /* Null */ ?
74652
+ function reportObjectPossiblyNullOrUndefinedError(node, facts) {
74653
+ error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
74659
74654
  ts.Diagnostics.Object_is_possibly_null_or_undefined :
74660
74655
  ts.Diagnostics.Object_is_possibly_undefined :
74661
74656
  ts.Diagnostics.Object_is_possibly_null);
74662
74657
  }
74663
- function reportCannotInvokePossiblyNullOrUndefinedError(node, flags) {
74664
- error(node, flags & 32768 /* Undefined */ ? flags & 65536 /* Null */ ?
74658
+ function reportCannotInvokePossiblyNullOrUndefinedError(node, facts) {
74659
+ error(node, facts & 16777216 /* IsUndefined */ ? facts & 33554432 /* IsNull */ ?
74665
74660
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined :
74666
74661
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined :
74667
74662
  ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);
@@ -74671,9 +74666,9 @@ var ts;
74671
74666
  error(node, ts.Diagnostics.Object_is_of_type_unknown);
74672
74667
  return errorType;
74673
74668
  }
74674
- var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 98304 /* Nullable */;
74675
- if (kind) {
74676
- reportError(node, kind);
74669
+ var facts = getTypeFacts(type);
74670
+ if (facts & 50331648 /* IsUndefinedOrNull */) {
74671
+ reportError(node, facts);
74677
74672
  var t = getNonNullableType(type);
74678
74673
  return t.flags & (98304 /* Nullable */ | 131072 /* Never */) ? errorType : t;
74679
74674
  }
@@ -74968,7 +74963,7 @@ var ts;
74968
74963
  assumeUninitialized = true;
74969
74964
  }
74970
74965
  var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
74971
- if (assumeUninitialized && !(getFalsyFlags(propType) & 32768 /* Undefined */) && getFalsyFlags(flowType) & 32768 /* Undefined */) {
74966
+ if (assumeUninitialized && !(getTypeFacts(propType) & 16777216 /* IsUndefined */) && getTypeFacts(flowType) & 16777216 /* IsUndefined */) {
74972
74967
  error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop)); // TODO: GH#18217
74973
74968
  // Return the declared type to reduce follow-on errors
74974
74969
  return propType;
@@ -76884,8 +76879,8 @@ var ts;
76884
76879
  if (apparentType.flags & 1048576 /* Union */) {
76885
76880
  var types = apparentType.types;
76886
76881
  var hasSignatures = false;
76887
- for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
76888
- var constituent = types_20[_i];
76882
+ for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
76883
+ var constituent = types_19[_i];
76889
76884
  var signatures = getSignaturesOfType(constituent, kind);
76890
76885
  if (signatures.length !== 0) {
76891
76886
  hasSignatures = true;
@@ -78576,7 +78571,7 @@ var ts;
78576
78571
  var type = getTypeOfSymbol(symbol);
78577
78572
  if (strictNullChecks &&
78578
78573
  !(type.flags & (3 /* AnyOrUnknown */ | 131072 /* Never */)) &&
78579
- !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getFalsyFlags(type) & 32768 /* Undefined */)) {
78574
+ !(exactOptionalPropertyTypes ? symbol.flags & 16777216 /* Optional */ : getTypeFacts(type) & 16777216 /* IsUndefined */)) {
78580
78575
  error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
78581
78576
  }
78582
78577
  }
@@ -78744,8 +78739,8 @@ var ts;
78744
78739
  }
78745
78740
  if (type.flags & 3145728 /* UnionOrIntersection */) {
78746
78741
  var types = type.types;
78747
- for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
78748
- var t = types_21[_i];
78742
+ for (var _i = 0, types_20 = types; _i < types_20.length; _i++) {
78743
+ var t = types_20[_i];
78749
78744
  if (maybeTypeOfKind(t, kind)) {
78750
78745
  return true;
78751
78746
  }
@@ -78972,7 +78967,7 @@ var ts;
78972
78967
  // In strict null checking mode, if a default value of a non-undefined type is specified, remove
78973
78968
  // undefined from the final type.
78974
78969
  if (strictNullChecks &&
78975
- !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 32768 /* Undefined */)) {
78970
+ !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216 /* IsUndefined */)) {
78976
78971
  sourceType = getTypeWithFacts(sourceType, 524288 /* NEUndefined */);
78977
78972
  }
78978
78973
  checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
@@ -79372,7 +79367,7 @@ var ts;
79372
79367
  case 56 /* BarBarToken */:
79373
79368
  case 75 /* BarBarEqualsToken */: {
79374
79369
  var resultType_3 = getTypeFacts(leftType) & 8388608 /* Falsy */ ?
79375
- getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) :
79370
+ getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2 /* Subtype */) :
79376
79371
  leftType;
79377
79372
  if (operator === 75 /* BarBarEqualsToken */) {
79378
79373
  checkAssignmentOperator(rightType);
@@ -81913,8 +81908,8 @@ var ts;
81913
81908
  }
81914
81909
  function getEntityNameForDecoratorMetadataFromTypeList(types) {
81915
81910
  var commonEntityName;
81916
- for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
81917
- var typeNode = types_22[_i];
81911
+ for (var _i = 0, types_21 = types; _i < types_21.length; _i++) {
81912
+ var typeNode = types_21[_i];
81918
81913
  while (typeNode.kind === 191 /* ParenthesizedType */ || typeNode.kind === 197 /* NamedTupleMember */) {
81919
81914
  typeNode = typeNode.type; // Skip parens if need be
81920
81915
  }
@@ -82780,7 +82775,7 @@ var ts;
82780
82775
  // For a binding pattern, validate the initializer and exit
82781
82776
  if (ts.isBindingPattern(node.name)) {
82782
82777
  var needCheckInitializer = node.initializer && node.parent.parent.kind !== 243 /* ForInStatement */;
82783
- var needCheckWidenedType = node.name.elements.length === 0;
82778
+ var needCheckWidenedType = !ts.some(node.name.elements, ts.not(ts.isOmittedExpression));
82784
82779
  if (needCheckInitializer || needCheckWidenedType) {
82785
82780
  // Don't validate for-in initializer as it is already an error
82786
82781
  var widenedType = getWidenedTypeForVariableLikeDeclaration(node);
@@ -82933,7 +82928,7 @@ var ts;
82933
82928
  return;
82934
82929
  var type = checkTruthinessExpression(location);
82935
82930
  var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
82936
- if (getFalsyFlags(type) || isPropertyExpressionCast)
82931
+ if (!(getTypeFacts(type) & 4194304 /* Truthy */) || isPropertyExpressionCast)
82937
82932
  return;
82938
82933
  // While it technically should be invalid for any known-truthy value
82939
82934
  // to be tested, we de-scope to functions and Promises unreferenced in
@@ -84619,18 +84614,17 @@ var ts;
84619
84614
  // but not by other kinds of members.
84620
84615
  // Base class instance member variables and accessors can be overridden by
84621
84616
  // derived class instance member variables and accessors, but not by other kinds of members.
84622
- var _a, _b;
84617
+ var _a, _b, _c, _d;
84623
84618
  // NOTE: assignability is checked in checkClassDeclaration
84624
84619
  var baseProperties = getPropertiesOfType(baseType);
84625
- basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
84626
- var baseProperty = baseProperties_1[_i];
84620
+ var _loop_33 = function (baseProperty) {
84627
84621
  var base = getTargetSymbol(baseProperty);
84628
84622
  if (base.flags & 4194304 /* Prototype */) {
84629
- continue;
84623
+ return "continue";
84630
84624
  }
84631
84625
  var baseSymbol = getPropertyOfObjectType(type, base.escapedName);
84632
84626
  if (!baseSymbol) {
84633
- continue;
84627
+ return "continue";
84634
84628
  }
84635
84629
  var derived = getTargetSymbol(baseSymbol);
84636
84630
  var baseDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(base);
@@ -84648,14 +84642,14 @@ var ts;
84648
84642
  // Searches other base types for a declaration that would satisfy the inherited abstract member.
84649
84643
  // (The class may have more than one base type via declaration merging with an interface with the
84650
84644
  // same name.)
84651
- for (var _c = 0, _d = getBaseTypes(type); _c < _d.length; _c++) {
84652
- var otherBaseType = _d[_c];
84645
+ for (var _e = 0, _f = getBaseTypes(type); _e < _f.length; _e++) {
84646
+ var otherBaseType = _f[_e];
84653
84647
  if (otherBaseType === baseType)
84654
84648
  continue;
84655
84649
  var baseSymbol_1 = getPropertyOfObjectType(otherBaseType, base.escapedName);
84656
84650
  var derivedElsewhere = baseSymbol_1 && getTargetSymbol(baseSymbol_1);
84657
84651
  if (derivedElsewhere && derivedElsewhere !== base) {
84658
- continue basePropertyCheck;
84652
+ return "continue-basePropertyCheck";
84659
84653
  }
84660
84654
  }
84661
84655
  if (derivedClassDecl.kind === 226 /* ClassExpression */) {
@@ -84670,20 +84664,19 @@ var ts;
84670
84664
  // derived overrides base.
84671
84665
  var derivedDeclarationFlags = ts.getDeclarationModifierFlagsFromSymbol(derived);
84672
84666
  if (baseDeclarationFlags & 8 /* Private */ || derivedDeclarationFlags & 8 /* Private */) {
84673
- // either base or derived property is private - not override, skip it
84674
- continue;
84667
+ return "continue";
84675
84668
  }
84676
84669
  var errorMessage = void 0;
84677
84670
  var basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
84678
84671
  var derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
84679
84672
  if (basePropertyFlags && derivedPropertyFlags) {
84680
84673
  // property/accessor is overridden with property/accessor
84681
- if (baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer)
84682
- || base.valueDeclaration && base.valueDeclaration.parent.kind === 258 /* InterfaceDeclaration */
84674
+ if ((ts.getCheckFlags(base) & 6 /* Synthetic */
84675
+ ? (_a = base.declarations) === null || _a === void 0 ? void 0 : _a.some(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); })
84676
+ : (_b = base.declarations) === null || _b === void 0 ? void 0 : _b.every(function (d) { return isPropertyAbstractOrInterface(d, baseDeclarationFlags); }))
84677
+ || ts.getCheckFlags(base) & 262144 /* Mapped */
84683
84678
  || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) {
84684
- // when the base property is abstract or from an interface, base/derived flags don't need to match
84685
- // same when the derived property is from an assignment
84686
- continue;
84679
+ return "continue";
84687
84680
  }
84688
84681
  var overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
84689
84682
  var overriddenInstanceAccessor = basePropertyFlags === 4 /* Property */ && derivedPropertyFlags !== 4 /* Property */;
@@ -84694,12 +84687,12 @@ var ts;
84694
84687
  error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type));
84695
84688
  }
84696
84689
  else if (useDefineForClassFields) {
84697
- var uninitialized = (_a = derived.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return d.kind === 167 /* PropertyDeclaration */ && !d.initializer; });
84690
+ var uninitialized = (_c = derived.declarations) === null || _c === void 0 ? void 0 : _c.find(function (d) { return d.kind === 167 /* PropertyDeclaration */ && !d.initializer; });
84698
84691
  if (uninitialized
84699
84692
  && !(derived.flags & 33554432 /* Transient */)
84700
84693
  && !(baseDeclarationFlags & 128 /* Abstract */)
84701
84694
  && !(derivedDeclarationFlags & 128 /* Abstract */)
84702
- && !((_b = derived.declarations) === null || _b === void 0 ? void 0 : _b.some(function (d) { return !!(d.flags & 16777216 /* Ambient */); }))) {
84695
+ && !((_d = derived.declarations) === null || _d === void 0 ? void 0 : _d.some(function (d) { return !!(d.flags & 16777216 /* Ambient */); }))) {
84703
84696
  var constructor = findConstructorDeclaration(ts.getClassLikeDeclarationOfSymbol(type.symbol));
84704
84697
  var propName = uninitialized.name;
84705
84698
  if (uninitialized.exclamationToken
@@ -84712,13 +84705,11 @@ var ts;
84712
84705
  }
84713
84706
  }
84714
84707
  }
84715
- // correct case
84716
- continue;
84708
+ return "continue";
84717
84709
  }
84718
84710
  else if (isPrototypeProperty(base)) {
84719
84711
  if (isPrototypeProperty(derived) || derived.flags & 4 /* Property */) {
84720
- // method is overridden with method or property -- correct case
84721
- continue;
84712
+ return "continue";
84722
84713
  }
84723
84714
  else {
84724
84715
  ts.Debug.assert(!!(derived.flags & 98304 /* Accessor */));
@@ -84733,9 +84724,20 @@ var ts;
84733
84724
  }
84734
84725
  error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
84735
84726
  }
84727
+ };
84728
+ basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
84729
+ var baseProperty = baseProperties_1[_i];
84730
+ var state_10 = _loop_33(baseProperty);
84731
+ switch (state_10) {
84732
+ case "continue-basePropertyCheck": continue basePropertyCheck;
84733
+ }
84736
84734
  }
84737
84735
  }
84738
- function getNonInterhitedProperties(type, baseTypes, properties) {
84736
+ function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
84737
+ return baseDeclarationFlags & 128 /* Abstract */ && (!ts.isPropertyDeclaration(declaration) || !declaration.initializer)
84738
+ || ts.isInterfaceDeclaration(declaration.parent);
84739
+ }
84740
+ function getNonInheritedProperties(type, baseTypes, properties) {
84739
84741
  if (!ts.length(baseTypes)) {
84740
84742
  return properties;
84741
84743
  }
@@ -84804,7 +84806,7 @@ var ts;
84804
84806
  var propName = member.name;
84805
84807
  if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
84806
84808
  var type = getTypeOfSymbol(getSymbolOfNode(member));
84807
- if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
84809
+ if (!(type.flags & 3 /* AnyOrUnknown */ || getTypeFacts(type) & 16777216 /* IsUndefined */)) {
84808
84810
  if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
84809
84811
  error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));
84810
84812
  }
@@ -84829,7 +84831,7 @@ var ts;
84829
84831
  ts.setParent(reference, staticBlock);
84830
84832
  reference.flowNode = staticBlock.returnFlowNode;
84831
84833
  var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
84832
- if (!(getFalsyFlags(flowType) & 32768 /* Undefined */)) {
84834
+ if (!(getTypeFacts(flowType) & 16777216 /* IsUndefined */)) {
84833
84835
  return true;
84834
84836
  }
84835
84837
  }
@@ -84844,7 +84846,7 @@ var ts;
84844
84846
  ts.setParent(reference, constructor);
84845
84847
  reference.flowNode = constructor.returnFlowNode;
84846
84848
  var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
84847
- return !(getFalsyFlags(flowType) & 32768 /* Undefined */);
84849
+ return !(getTypeFacts(flowType) & 16777216 /* IsUndefined */);
84848
84850
  }
84849
84851
  function checkInterfaceDeclaration(node) {
84850
84852
  // Grammar checking
@@ -93134,8 +93136,8 @@ var ts;
93134
93136
  // Note when updating logic here also update getEntityNameForDecoratorMetadata
93135
93137
  // so that aliases can be marked as referenced
93136
93138
  var serializedUnion;
93137
- for (var _i = 0, types_23 = types; _i < types_23.length; _i++) {
93138
- var typeNode = types_23[_i];
93139
+ for (var _i = 0, types_22 = types; _i < types_22.length; _i++) {
93140
+ var typeNode = types_22[_i];
93139
93141
  while (typeNode.kind === 191 /* ParenthesizedType */) {
93140
93142
  typeNode = typeNode.type; // Skip parens if need be
93141
93143
  }
@@ -113750,8 +113752,8 @@ var ts;
113750
113752
  bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
113751
113753
  writeLine();
113752
113754
  }
113753
- for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
113754
- var directive = types_24[_d];
113755
+ for (var _d = 0, types_23 = types; _d < types_23.length; _d++) {
113756
+ var directive = types_23[_d];
113755
113757
  var pos = writer.getTextPos();
113756
113758
  var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat)
113757
113759
  ? "resolution-mode=\"" + (directive.resolutionMode === ts.ModuleKind.ESNext ? "import" : "require") + "\""
@@ -122519,7 +122521,7 @@ var ts;
122519
122521
  });
122520
122522
  // Sort by paths closest to importing file Name directory
122521
122523
  var sortedPaths = [];
122522
- var _loop_33 = function (directory) {
122524
+ var _loop_34 = function (directory) {
122523
122525
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
122524
122526
  var pathsInDirectory;
122525
122527
  allFileNames.forEach(function (_a, fileName) {
@@ -122543,9 +122545,9 @@ var ts;
122543
122545
  };
122544
122546
  var out_directory_1;
122545
122547
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
122546
- var state_10 = _loop_33(directory);
122548
+ var state_11 = _loop_34(directory);
122547
122549
  directory = out_directory_1;
122548
- if (state_10 === "break")
122550
+ if (state_11 === "break")
122549
122551
  break;
122550
122552
  }
122551
122553
  if (allFileNames.size) {
@@ -144648,7 +144650,7 @@ var ts;
144648
144650
  if (!ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth())) {
144649
144651
  return;
144650
144652
  }
144651
- if (ts.isTypeNode(node)) {
144653
+ if (ts.isTypeNode(node) && !ts.isExpressionWithTypeArguments(node)) {
144652
144654
  return;
144653
144655
  }
144654
144656
  if (preferences.includeInlayVariableTypeHints && ts.isVariableDeclaration(node)) {
@@ -147759,7 +147761,6 @@ var ts;
147759
147761
  case 280 /* JsxOpeningElement */:
147760
147762
  case 281 /* JsxClosingElement */:
147761
147763
  case 279 /* JsxSelfClosingElement */:
147762
- case 228 /* ExpressionWithTypeArguments */:
147763
147764
  return false;
147764
147765
  }
147765
147766
  break;
@@ -147929,7 +147930,7 @@ var ts;
147929
147930
  var listEndToken = getCloseTokenForOpenToken(listStartToken);
147930
147931
  if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) {
147931
147932
  var tokenInfo = formattingScanner.readTokenInfo(parent);
147932
- if (tokenInfo.token.kind === 27 /* CommaToken */ && ts.isCallLikeExpression(parent)) {
147933
+ if (tokenInfo.token.kind === 27 /* CommaToken */) {
147933
147934
  // consume the comma
147934
147935
  consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation, parent);
147935
147936
  tokenInfo = formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(parent) : undefined;
@@ -148333,6 +148334,12 @@ var ts;
148333
148334
  case 169 /* MethodDeclaration */:
148334
148335
  case 168 /* MethodSignature */:
148335
148336
  case 214 /* ArrowFunction */:
148337
+ case 174 /* CallSignature */:
148338
+ case 175 /* ConstructSignature */:
148339
+ case 179 /* FunctionType */:
148340
+ case 180 /* ConstructorType */:
148341
+ case 172 /* GetAccessor */:
148342
+ case 173 /* SetAccessor */:
148336
148343
  if (node.typeParameters === list) {
148337
148344
  return 29 /* LessThanToken */;
148338
148345
  }
@@ -148349,7 +148356,19 @@ var ts;
148349
148356
  return 20 /* OpenParenToken */;
148350
148357
  }
148351
148358
  break;
148359
+ case 257 /* ClassDeclaration */:
148360
+ case 226 /* ClassExpression */:
148361
+ case 258 /* InterfaceDeclaration */:
148362
+ case 259 /* TypeAliasDeclaration */:
148363
+ if (node.typeParameters === list) {
148364
+ return 29 /* LessThanToken */;
148365
+ }
148366
+ break;
148352
148367
  case 178 /* TypeReference */:
148368
+ case 210 /* TaggedTemplateExpression */:
148369
+ case 181 /* TypeQuery */:
148370
+ case 228 /* ExpressionWithTypeArguments */:
148371
+ case 200 /* ImportType */:
148353
148372
  if (node.typeArguments === list) {
148354
148373
  return 29 /* LessThanToken */;
148355
148374
  }