typescript 5.0.0-dev.20230110 → 5.0.0-dev.20230112

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
@@ -42,7 +42,7 @@ var ts = (() => {
42
42
  "src/compiler/corePublic.ts"() {
43
43
  "use strict";
44
44
  versionMajorMinor = "5.0";
45
- version = `${versionMajorMinor}.0-dev.20230110`;
45
+ version = `${versionMajorMinor}.0-dev.20230112`;
46
46
  Comparison = /* @__PURE__ */ ((Comparison3) => {
47
47
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
48
48
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8023,6 +8023,7 @@ ${lanes.join("\n")}
8023
8023
  Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
8024
8024
  Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
8025
8025
  Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
8026
+ Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
8026
8027
  Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),
8027
8028
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
8028
8029
  Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
@@ -9526,7 +9527,8 @@ ${lanes.join("\n")}
9526
9527
  return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
9527
9528
  }
9528
9529
  function isIdentifierPart(ch, languageVersion, identifierVariant) {
9529
- return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
9530
+ return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || // "-" and ":" are valid in JSX Identifiers
9531
+ (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
9530
9532
  }
9531
9533
  function isIdentifierText(name, languageVersion, identifierVariant) {
9532
9534
  let ch = codePointAt(name, 0);
@@ -18397,6 +18399,10 @@ ${lanes.join("\n")}
18397
18399
  return false;
18398
18400
  }
18399
18401
  }
18402
+ function isNonNullAccess(node) {
18403
+ const kind = node.kind;
18404
+ return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
18405
+ }
18400
18406
  var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
18401
18407
  var init_utilities = __esm({
18402
18408
  "src/compiler/utilities.ts"() {
@@ -34986,7 +34992,8 @@ ${lanes.join("\n")}
34986
34992
  if (returnValue) {
34987
34993
  result[keyText] = value;
34988
34994
  }
34989
- if (jsonConversionNotifier && (parentOption || isRootOptionMap(knownOptions))) {
34995
+ if (jsonConversionNotifier && // Current callbacks are only on known parent option or if we are setting values in the root
34996
+ (parentOption || isRootOptionMap(knownOptions))) {
34990
34997
  const isValidOptionValue = isCompilerOptionsValue(option, value);
34991
34998
  if (parentOption) {
34992
34999
  if (isValidOptionValue) {
@@ -38031,7 +38038,8 @@ ${lanes.join("\n")}
38031
38038
  conditions,
38032
38039
  requestContainingDirectory: containingDirectory,
38033
38040
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
38034
- isConfigLookup: false
38041
+ isConfigLookup: false,
38042
+ candidateIsFromPackageJsonField: false
38035
38043
  };
38036
38044
  let resolved = primaryLookup();
38037
38045
  let primary = true;
@@ -38889,7 +38897,8 @@ ${lanes.join("\n")}
38889
38897
  conditions,
38890
38898
  requestContainingDirectory: containingDirectory,
38891
38899
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
38892
- isConfigLookup
38900
+ isConfigLookup,
38901
+ candidateIsFromPackageJsonField: false
38893
38902
  };
38894
38903
  if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
38895
38904
  trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
@@ -39112,7 +39121,7 @@ ${lanes.join("\n")}
39112
39121
  }
39113
39122
  function tryExtension(ext, resolvedUsingTsExtension) {
39114
39123
  const path = tryFile(candidate + ext, onlyRecordFailures, state);
39115
- return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension };
39124
+ return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
39116
39125
  }
39117
39126
  }
39118
39127
  function tryFile(fileName, onlyRecordFailures, state) {
@@ -39259,7 +39268,8 @@ ${lanes.join("\n")}
39259
39268
  conditions: emptyArray,
39260
39269
  requestContainingDirectory: void 0,
39261
39270
  reportDiagnostic: noop,
39262
- isConfigLookup: false
39271
+ isConfigLookup: false,
39272
+ candidateIsFromPackageJsonField: false
39263
39273
  };
39264
39274
  }
39265
39275
  function getPackageScopeForPath(fileName, state) {
@@ -39347,6 +39357,8 @@ ${lanes.join("\n")}
39347
39357
  }
39348
39358
  const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
39349
39359
  const features = state2.features;
39360
+ const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
39361
+ state2.candidateIsFromPackageJsonField = true;
39350
39362
  if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
39351
39363
  state2.features &= ~32 /* EsmMode */;
39352
39364
  }
@@ -39359,6 +39371,7 @@ ${lanes.join("\n")}
39359
39371
  false
39360
39372
  );
39361
39373
  state2.features = features;
39374
+ state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField;
39362
39375
  return result;
39363
39376
  };
39364
39377
  const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
@@ -39432,7 +39445,10 @@ ${lanes.join("\n")}
39432
39445
  return void 0;
39433
39446
  }
39434
39447
  const trailingParts = parts.slice(nameParts.length);
39435
- return loadModuleFromExports(scope, extensions, !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`, state, cache, redirectedReference);
39448
+ const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
39449
+ const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
39450
+ const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
39451
+ return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
39436
39452
  }
39437
39453
  function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
39438
39454
  if (!scope.contents.packageJsonContent.exports) {
@@ -39934,25 +39950,26 @@ ${lanes.join("\n")}
39934
39950
  }
39935
39951
  }
39936
39952
  function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
39937
- var _a2;
39953
+ var _a2, _b, _c;
39938
39954
  const candidate = normalizePath(combinePaths(nodeModulesDirectory, moduleName));
39955
+ const { packageName, rest } = parsePackageName(moduleName);
39956
+ const packageDirectory = combinePaths(nodeModulesDirectory, packageName);
39957
+ let rootPackageInfo;
39939
39958
  let packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
39940
- if (!(state.features & 8 /* Exports */)) {
39941
- if (packageInfo) {
39942
- const fromFile = loadModuleFromFile(extensions, candidate, !nodeModulesDirectoryExists, state);
39943
- if (fromFile) {
39944
- return noPackageId(fromFile);
39945
- }
39946
- const fromDirectory = loadNodeModuleFromDirectoryWorker(
39947
- extensions,
39948
- candidate,
39949
- !nodeModulesDirectoryExists,
39950
- state,
39951
- packageInfo.contents.packageJsonContent,
39952
- getVersionPathsOfPackageJsonInfo(packageInfo, state)
39953
- );
39954
- return withPackageId(packageInfo, fromDirectory);
39959
+ if (rest !== "" && packageInfo && (!(state.features & 8 /* Exports */) || !hasProperty((_b = (_a2 = rootPackageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state)) == null ? void 0 : _a2.contents.packageJsonContent) != null ? _b : emptyArray, "exports"))) {
39960
+ const fromFile = loadModuleFromFile(extensions, candidate, !nodeModulesDirectoryExists, state);
39961
+ if (fromFile) {
39962
+ return noPackageId(fromFile);
39955
39963
  }
39964
+ const fromDirectory = loadNodeModuleFromDirectoryWorker(
39965
+ extensions,
39966
+ candidate,
39967
+ !nodeModulesDirectoryExists,
39968
+ state,
39969
+ packageInfo.contents.packageJsonContent,
39970
+ getVersionPathsOfPackageJsonInfo(packageInfo, state)
39971
+ );
39972
+ return withPackageId(packageInfo, fromDirectory);
39956
39973
  }
39957
39974
  const loader = (extensions2, candidate2, onlyRecordFailures, state2) => {
39958
39975
  let pathAndExtension = loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(
@@ -39968,13 +39985,11 @@ ${lanes.join("\n")}
39968
39985
  }
39969
39986
  return withPackageId(packageInfo, pathAndExtension);
39970
39987
  };
39971
- const { packageName, rest } = parsePackageName(moduleName);
39972
- const packageDirectory = combinePaths(nodeModulesDirectory, packageName);
39973
39988
  if (rest !== "") {
39974
- packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
39989
+ packageInfo = rootPackageInfo != null ? rootPackageInfo : getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
39975
39990
  }
39976
39991
  if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & 8 /* Exports */) {
39977
- return (_a2 = loadModuleFromExports(packageInfo, extensions, combinePaths(".", rest), state, cache, redirectedReference)) == null ? void 0 : _a2.value;
39992
+ return (_c = loadModuleFromExports(packageInfo, extensions, combinePaths(".", rest), state, cache, redirectedReference)) == null ? void 0 : _c.value;
39978
39993
  }
39979
39994
  const versionPaths = rest !== "" && packageInfo ? getVersionPathsOfPackageJsonInfo(packageInfo, state) : void 0;
39980
39995
  if (versionPaths) {
@@ -40090,7 +40105,8 @@ ${lanes.join("\n")}
40090
40105
  conditions: [],
40091
40106
  requestContainingDirectory: containingDirectory,
40092
40107
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
40093
- isConfigLookup: false
40108
+ isConfigLookup: false,
40109
+ candidateIsFromPackageJsonField: false
40094
40110
  };
40095
40111
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
40096
40112
  return createResolvedModuleWithFailedLookupLocations(
@@ -40169,7 +40185,8 @@ ${lanes.join("\n")}
40169
40185
  conditions: [],
40170
40186
  requestContainingDirectory: void 0,
40171
40187
  reportDiagnostic: (diag2) => void diagnostics.push(diag2),
40172
- isConfigLookup: false
40188
+ isConfigLookup: false,
40189
+ candidateIsFromPackageJsonField: false
40173
40190
  };
40174
40191
  const resolved = loadModuleFromImmediateNodeModulesDirectory(
40175
40192
  4 /* Declaration */,
@@ -42952,8 +42969,12 @@ ${lanes.join("\n")}
42952
42969
  return false;
42953
42970
  }
42954
42971
  if (currentFlow === unreachableFlow) {
42955
- const reportError = isStatementButNotDeclaration(node) && node.kind !== 239 /* EmptyStatement */ || // report error on class declarations
42956
- node.kind === 260 /* ClassDeclaration */ || node.kind === 264 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
42972
+ const reportError = (
42973
+ // report error on all statements except empty ones
42974
+ isStatementButNotDeclaration(node) && node.kind !== 239 /* EmptyStatement */ || // report error on class declarations
42975
+ node.kind === 260 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set
42976
+ node.kind === 264 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)
42977
+ );
42957
42978
  if (reportError) {
42958
42979
  currentFlow = reportedUnreachableFlow;
42959
42980
  if (!options.allowUnreachableCode) {
@@ -48716,7 +48737,8 @@ ${lanes.join("\n")}
48716
48737
  const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
48717
48738
  forEach(symbol.declarations, (declaration) => declaration.parent.kind === 308 /* SourceFile */ || declaration.parent.kind === 265 /* ModuleBlock */));
48718
48739
  if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
48719
- return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a4 = context.visitedTypes) == null ? void 0 : _a4.has(typeId))) && (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
48740
+ return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a4 = context.visitedTypes) == null ? void 0 : _a4.has(typeId))) && // it is type of the symbol uses itself recursively
48741
+ (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
48720
48742
  }
48721
48743
  }
48722
48744
  }
@@ -48808,7 +48830,9 @@ ${lanes.join("\n")}
48808
48830
  const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */));
48809
48831
  if (some(abstractSignatures)) {
48810
48832
  const types = map(abstractSignatures, getOrCreateTypeFromSignature);
48811
- const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
48833
+ const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per
48834
+ // the logic in `createTypeNodesFromResolvedType`.
48835
+ (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
48812
48836
  if (typeElementCount) {
48813
48837
  types.push(getResolvedTypeWithoutAbstractConstructSignatures(resolved));
48814
48838
  }
@@ -49470,9 +49494,11 @@ ${lanes.join("\n")}
49470
49494
  if (accessibleSymbolChain) {
49471
49495
  return accessibleSymbolChain;
49472
49496
  }
49473
- if (// If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.
49474
- endOfChain || // If a parent symbol is an anonymous type, don't write it.
49475
- !(symbol2.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))) {
49497
+ if (
49498
+ // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.
49499
+ endOfChain || // If a parent symbol is an anonymous type, don't write it.
49500
+ !(symbol2.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))
49501
+ ) {
49476
49502
  if (!endOfChain && !yieldModuleSymbol && !!forEach(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
49477
49503
  return;
49478
49504
  }
@@ -50094,7 +50120,8 @@ ${lanes.join("\n")}
50094
50120
  }
50095
50121
  if (isLiteralImportTypeNode(node)) {
50096
50122
  const nodeSymbol = getNodeLinks(node).resolvedSymbol;
50097
- if (isInJSDoc(node) && nodeSymbol && (!node.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
50123
+ if (isInJSDoc(node) && nodeSymbol && // The import type resolved using jsdoc fallback logic
50124
+ (!node.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
50098
50125
  !(length(node.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol))))) {
50099
50126
  return setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);
50100
50127
  }
@@ -51611,8 +51638,10 @@ ${lanes.join("\n")}
51611
51638
  }
51612
51639
  }
51613
51640
  function getNameOfSymbolAsWritten(symbol, context) {
51614
- if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && (!(context.flags & 16777216 /* InInitialEntityName */) || // if the symbol is synthesized, it will only be referenced externally it must print as `default`
51615
- !symbol.declarations || context.enclosingDeclaration && findAncestor(symbol.declarations[0], isDefaultBindingContext) !== findAncestor(context.enclosingDeclaration, isDefaultBindingContext))) {
51641
+ if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && // If it's not the first part of an entity name, it must print as `default`
51642
+ (!(context.flags & 16777216 /* InInitialEntityName */) || // if the symbol is synthesized, it will only be referenced externally it must print as `default`
51643
+ !symbol.declarations || // if not in the same binding context (source file, module declaration), it must print as `default`
51644
+ context.enclosingDeclaration && findAncestor(symbol.declarations[0], isDefaultBindingContext) !== findAncestor(context.enclosingDeclaration, isDefaultBindingContext))) {
51616
51645
  return "default";
51617
51646
  }
51618
51647
  if (symbol.declarations && symbol.declarations.length) {
@@ -52939,7 +52968,10 @@ ${lanes.join("\n")}
52939
52968
  function getWriteTypeOfSymbol(symbol) {
52940
52969
  const checkFlags = getCheckFlags(symbol);
52941
52970
  if (symbol.flags & 4 /* Property */) {
52942
- return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : symbol.links.writeType || symbol.links.type : getTypeOfSymbol(symbol);
52971
+ return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
52972
+ // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
52973
+ symbol.links.writeType || symbol.links.type
52974
+ ) : getTypeOfSymbol(symbol);
52943
52975
  }
52944
52976
  if (symbol.flags & 98304 /* Accessor */) {
52945
52977
  return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
@@ -53064,7 +53096,17 @@ ${lanes.join("\n")}
53064
53096
  }
53065
53097
  }
53066
53098
  function getOuterTypeParametersOfClassOrInterface(symbol) {
53067
- const declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : getDeclarationOfKind(symbol, 261 /* InterfaceDeclaration */);
53099
+ var _a2;
53100
+ const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => {
53101
+ if (decl.kind === 261 /* InterfaceDeclaration */) {
53102
+ return true;
53103
+ }
53104
+ if (decl.kind !== 257 /* VariableDeclaration */) {
53105
+ return false;
53106
+ }
53107
+ const initializer = decl.initializer;
53108
+ return !!initializer && (initializer.kind === 215 /* FunctionExpression */ || initializer.kind === 216 /* ArrowFunction */);
53109
+ });
53068
53110
  Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
53069
53111
  return getOuterTypeParameters(declaration);
53070
53112
  }
@@ -61346,7 +61388,11 @@ ${lanes.join("\n")}
61346
61388
  if (variances === emptyArray) {
61347
61389
  return 1 /* Unknown */;
61348
61390
  }
61349
- const varianceResult = relateVariances(source2.aliasTypeArguments, target2.aliasTypeArguments, variances, intersectionState);
61391
+ const params = getSymbolLinks(source2.aliasSymbol).typeParameters;
61392
+ const minParams = getMinTypeArgumentCount(params);
61393
+ const sourceTypes = fillMissingTypeArguments(source2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration));
61394
+ const targetTypes = fillMissingTypeArguments(target2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration));
61395
+ const varianceResult = relateVariances(sourceTypes, targetTypes, variances, intersectionState);
61350
61396
  if (varianceResult !== void 0) {
61351
61397
  return varianceResult;
61352
61398
  }
@@ -63803,7 +63849,11 @@ ${lanes.join("\n")}
63803
63849
  }
63804
63850
  if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
63805
63851
  if (source.aliasTypeArguments) {
63806
- inferFromTypeArguments(source.aliasTypeArguments, target.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
63852
+ const params = getSymbolLinks(source.aliasSymbol).typeParameters;
63853
+ const minParams = getMinTypeArgumentCount(params);
63854
+ const sourceTypes = fillMissingTypeArguments(source.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration));
63855
+ const targetTypes = fillMissingTypeArguments(target.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration));
63856
+ inferFromTypeArguments(sourceTypes, targetTypes, getAliasVariances(source.aliasSymbol));
63807
63857
  }
63808
63858
  return;
63809
63859
  }
@@ -64409,7 +64459,7 @@ ${lanes.join("\n")}
64409
64459
  if (signature) {
64410
64460
  const inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : void 0;
64411
64461
  if (inference.contraCandidates) {
64412
- const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other === inference || getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType)));
64462
+ const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType)));
64413
64463
  inferredType = useCovariantType ? inferredCovariantType : getContravariantInference(inference);
64414
64464
  } else if (inferredCovariantType) {
64415
64465
  inferredType = inferredCovariantType;
@@ -65885,12 +65935,13 @@ ${lanes.join("\n")}
65885
65935
  if (propName === void 0) {
65886
65936
  return type;
65887
65937
  }
65888
- const removeNullable = strictNullChecks && isOptionalChain(access) && maybeTypeOfKind(type, 98304 /* Nullable */);
65938
+ const optionalChain = isOptionalChain(access);
65939
+ const removeNullable = strictNullChecks && (optionalChain || isNonNullAccess(access)) && maybeTypeOfKind(type, 98304 /* Nullable */);
65889
65940
  let propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName);
65890
65941
  if (!propType) {
65891
65942
  return type;
65892
65943
  }
65893
- propType = removeNullable ? getOptionalType(propType) : propType;
65944
+ propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
65894
65945
  const narrowedPropType = narrowType2(propType);
65895
65946
  return filterType(type, (t) => {
65896
65947
  const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
@@ -66209,18 +66260,20 @@ ${lanes.join("\n")}
66209
66260
  return narrowTypeByTypeFacts(type, nonPrimitiveType, 128 /* TypeofEQHostObject */);
66210
66261
  }
66211
66262
  function narrowTypeByTypeFacts(type, impliedType, facts) {
66212
- return mapType(type, (t) => // We first check if a constituent is a subtype of the implied type. If so, we either keep or eliminate
66213
- // the constituent based on its type facts. We use the strict subtype relation because it treats `object`
66214
- // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`,
66215
- // but are classified as "function" according to `typeof`.
66216
- isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t) & facts ? t : neverType : (
66217
- // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied
66218
- // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`.
66219
- isTypeSubtypeOf(impliedType, t) ? impliedType : (
66220
- // Neither the constituent nor the implied type is a subtype of the other, however their domains may still
66221
- // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate
66222
- // possible overlap, we form an intersection. Otherwise, we eliminate the constituent.
66223
- getTypeFacts(t) & facts ? getIntersectionType([t, impliedType]) : neverType
66263
+ return mapType(type, (t) => (
66264
+ // We first check if a constituent is a subtype of the implied type. If so, we either keep or eliminate
66265
+ // the constituent based on its type facts. We use the strict subtype relation because it treats `object`
66266
+ // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`,
66267
+ // but are classified as "function" according to `typeof`.
66268
+ isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t) & facts ? t : neverType : (
66269
+ // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied
66270
+ // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`.
66271
+ isTypeSubtypeOf(impliedType, t) ? impliedType : (
66272
+ // Neither the constituent nor the implied type is a subtype of the other, however their domains may still
66273
+ // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate
66274
+ // possible overlap, we form an intersection. Otherwise, we eliminate the constituent.
66275
+ getTypeFacts(t) & facts ? getIntersectionType([t, impliedType]) : neverType
66276
+ )
66224
66277
  )
66225
66278
  ));
66226
66279
  }
@@ -73791,7 +73844,8 @@ ${lanes.join("\n")}
73791
73844
  }
73792
73845
  }
73793
73846
  function isIndirectCall(node) {
73794
- return node.parent.kind === 214 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 212 /* TaggedTemplateExpression */) && (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval");
73847
+ return node.parent.kind === 214 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 212 /* TaggedTemplateExpression */) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior.
73848
+ (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval");
73795
73849
  }
73796
73850
  function checkForDisallowedESSymbolOperand(operator2) {
73797
73851
  const offendingSymbolOperand = maybeTypeOfKindConsideringBaseConstraint(leftType, 12288 /* ESSymbolLike */) ? left : maybeTypeOfKindConsideringBaseConstraint(rightType, 12288 /* ESSymbolLike */) ? right : void 0;
@@ -80876,7 +80930,12 @@ ${lanes.join("\n")}
80876
80930
  return false;
80877
80931
  const symbol = getSymbolOfDeclaration(node);
80878
80932
  const signaturesOfSymbol = getSignaturesOfSymbol(symbol);
80879
- return signaturesOfSymbol.length > 1 || signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node;
80933
+ return signaturesOfSymbol.length > 1 || // If there is single signature for the symbol, it is overload if that signature isn't coming from the node
80934
+ // e.g.: function foo(a: string): string;
80935
+ // function foo(a: any) { // This is implementation of the overloads
80936
+ // return a;
80937
+ // }
80938
+ signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node;
80880
80939
  }
80881
80940
  return false;
80882
80941
  }
@@ -102777,6 +102836,9 @@ ${lanes.join("\n")}
102777
102836
  case 259 /* FunctionDeclaration */:
102778
102837
  diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
102779
102838
  break;
102839
+ case 192 /* InferType */:
102840
+ diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;
102841
+ break;
102780
102842
  case 262 /* TypeAliasDeclaration */:
102781
102843
  diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
102782
102844
  break;
@@ -111731,7 +111793,8 @@ ${lanes.join("\n")}
111731
111793
  const oldSourceFiles = oldProgram.getSourceFiles();
111732
111794
  for (const oldSourceFile of oldSourceFiles) {
111733
111795
  const newFile = getSourceFileByPath(oldSourceFile.resolvedPath);
111734
- if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat || oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path) {
111796
+ if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat || // old file wasn't redirect but new file is
111797
+ oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path) {
111735
111798
  host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path));
111736
111799
  }
111737
111800
  }
@@ -116617,7 +116680,8 @@ ${lanes.join("\n")}
116617
116680
  const name = loader.nameAndMode.getName(entry);
116618
116681
  const mode = loader.nameAndMode.getMode(entry, containingSourceFile);
116619
116682
  let resolution = resolutionsInFile.get(name, mode);
116620
- if (!seenNamesInFile.has(name, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution)) {
116683
+ if (!seenNamesInFile.has(name, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate
116684
+ hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution)) {
116621
116685
  const existingResolution = resolution;
116622
116686
  resolution = loader.resolve(name, mode);
116623
116687
  if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
@@ -122290,7 +122354,11 @@ ${lanes.join("\n")}
122290
122354
  return n;
122291
122355
  }
122292
122356
  return firstDefined(n.getChildren(sourceFile), (child) => {
122293
- const shouldDiveInChildNode = child.pos <= previousToken.pos && child.end > previousToken.end || child.pos === previousToken.end;
122357
+ const shouldDiveInChildNode = (
122358
+ // previous token is enclosed somewhere in the child
122359
+ child.pos <= previousToken.pos && child.end > previousToken.end || // previous token ends exactly at the beginning of child
122360
+ child.pos === previousToken.end
122361
+ );
122294
122362
  return shouldDiveInChildNode && nodeHasTokens(child, sourceFile) ? find2(child) : void 0;
122295
122363
  });
122296
122364
  }
@@ -135961,15 +136029,17 @@ ${lanes.join("\n")}
135961
136029
  return fixes[0];
135962
136030
  }
135963
136031
  return fixes.reduce(
135964
- (best, fix) => // Takes true branch of conditional if `fix` is better than `best`
135965
- compareModuleSpecifiers(
135966
- fix,
135967
- best,
135968
- sourceFile,
135969
- program,
135970
- packageJsonImportFilter.allowsImportingSpecifier,
135971
- (fileName) => toPath(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host))
135972
- ) === -1 /* LessThan */ ? fix : best
136032
+ (best, fix) => (
136033
+ // Takes true branch of conditional if `fix` is better than `best`
136034
+ compareModuleSpecifiers(
136035
+ fix,
136036
+ best,
136037
+ sourceFile,
136038
+ program,
136039
+ packageJsonImportFilter.allowsImportingSpecifier,
136040
+ (fileName) => toPath(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host))
136041
+ ) === -1 /* LessThan */ ? fix : best
136042
+ )
135973
136043
  );
135974
136044
  }
135975
136045
  function compareModuleSpecifiers(a, b, importingFile, program, allowsImportingSpecifier, toPath3) {
@@ -145465,7 +145535,10 @@ ${lanes.join("\n")}
145465
145535
  return containingNodeKind === 257 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 240 /* VariableStatement */ || containingNodeKind === 263 /* EnumDeclaration */ || // enum a { foo, |
145466
145536
  isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 261 /* InterfaceDeclaration */ || // interface A<T, |
145467
145537
  containingNodeKind === 204 /* ArrayBindingPattern */ || // var [x, y|
145468
- containingNodeKind === 262 /* TypeAliasDeclaration */ || isClassLike(parent2) && !!parent2.typeParameters && parent2.typeParameters.end >= contextToken2.pos;
145538
+ containingNodeKind === 262 /* TypeAliasDeclaration */ || // type Map, K, |
145539
+ // class A<T, |
145540
+ // var C = class D<T, |
145541
+ isClassLike(parent2) && !!parent2.typeParameters && parent2.typeParameters.end >= contextToken2.pos;
145469
145542
  case 24 /* DotToken */:
145470
145543
  return containingNodeKind === 204 /* ArrayBindingPattern */;
145471
145544
  case 58 /* ColonToken */:
@@ -147482,8 +147555,10 @@ ${lanes.join("\n")}
147482
147555
  return map2;
147483
147556
  }
147484
147557
  function forEachPossibleImportOrExportStatement(sourceFileLike, action) {
147485
- return forEach(sourceFileLike.kind === 308 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => // TODO: GH#18217
147486
- action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action));
147558
+ return forEach(sourceFileLike.kind === 308 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => (
147559
+ // TODO: GH#18217
147560
+ action(statement) || isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action)
147561
+ ));
147487
147562
  }
147488
147563
  function forEachImport(sourceFile, action) {
147489
147564
  if (sourceFile.externalModuleIndicator || sourceFile.imports !== void 0) {
@@ -147752,7 +147827,9 @@ ${lanes.join("\n")}
147752
147827
  return propertyName ? getContextNode(propertyName.parent) : void 0;
147753
147828
  }
147754
147829
  if (node.parent.name === node || // node is name of declaration, use parent
147755
- isConstructorDeclaration(node.parent) || isExportAssignment(node.parent) || (isImportOrExportSpecifier(node.parent) || isBindingElement(node.parent)) && node.parent.propertyName === node || node.kind === 88 /* DefaultKeyword */ && hasSyntacticModifier(node.parent, 1025 /* ExportDefault */)) {
147830
+ isConstructorDeclaration(node.parent) || isExportAssignment(node.parent) || // Property name of the import export specifier or binding pattern, use parent
147831
+ (isImportOrExportSpecifier(node.parent) || isBindingElement(node.parent)) && node.parent.propertyName === node || // Is default export
147832
+ node.kind === 88 /* DefaultKeyword */ && hasSyntacticModifier(node.parent, 1025 /* ExportDefault */)) {
147756
147833
  return getContextNode(node.parent);
147757
147834
  }
147758
147835
  return void 0;
@@ -147806,11 +147883,13 @@ ${lanes.join("\n")}
147806
147883
  const checker = program.getTypeChecker();
147807
147884
  const adjustedNode = Core.getAdjustedNode(node, options);
147808
147885
  const symbol = isDefinitionForReference(adjustedNode) ? checker.getSymbolAtLocation(adjustedNode) : void 0;
147809
- return !referencedSymbols || !referencedSymbols.length ? void 0 : mapDefined(referencedSymbols, ({ definition, references }) => // Only include referenced symbols that have a valid definition.
147810
- definition && {
147811
- definition: checker.runWithCancellationToken(cancellationToken, (checker2) => definitionToReferencedSymbolDefinitionInfo(definition, checker2, node)),
147812
- references: references.map((r) => toReferencedSymbolEntry(r, symbol))
147813
- });
147886
+ return !referencedSymbols || !referencedSymbols.length ? void 0 : mapDefined(referencedSymbols, ({ definition, references }) => (
147887
+ // Only include referenced symbols that have a valid definition.
147888
+ definition && {
147889
+ definition: checker.runWithCancellationToken(cancellationToken, (checker2) => definitionToReferencedSymbolDefinitionInfo(definition, checker2, node)),
147890
+ references: references.map((r) => toReferencedSymbolEntry(r, symbol))
147891
+ }
147892
+ ));
147814
147893
  }
147815
147894
  function isDefinitionForReference(node) {
147816
147895
  return node.kind === 88 /* DefaultKeyword */ || !!getDeclarationFromName(node) || isLiteralComputedPropertyDeclarationName(node) || node.kind === 135 /* ConstructorKeyword */ && isConstructorDeclaration(node.parent);
@@ -148848,8 +148927,10 @@ ${lanes.join("\n")}
148848
148927
  function getLabelReferencesInNode(container, targetLabel) {
148849
148928
  const sourceFile = container.getSourceFile();
148850
148929
  const labelName = targetLabel.text;
148851
- const references = mapDefined(getPossibleSymbolReferenceNodes(sourceFile, labelName, container), (node) => // Only pick labels that are either the target label, or have a target that is the target label
148852
- node === targetLabel || isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel ? nodeEntry(node) : void 0);
148930
+ const references = mapDefined(getPossibleSymbolReferenceNodes(sourceFile, labelName, container), (node) => (
148931
+ // Only pick labels that are either the target label, or have a target that is the target label
148932
+ node === targetLabel || isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel ? nodeEntry(node) : void 0
148933
+ ));
148853
148934
  return [{ definition: { type: 1 /* Label */, node: targetLabel }, references }];
148854
148935
  }
148855
148936
  function isValidReferencePosition(node, searchSymbolName) {
@@ -157990,7 +158071,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157990
158071
  hasAddedSymbolInfo = true;
157991
158072
  hasMultipleSignatures = allSignatures.length > 1;
157992
158073
  }
157993
- } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || location.kind === 135 /* ConstructorKeyword */ && location.parent.kind === 173 /* Constructor */) {
158074
+ } else if (isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */) || // name of function declaration
158075
+ location.kind === 135 /* ConstructorKeyword */ && location.parent.kind === 173 /* Constructor */) {
157994
158076
  const functionDeclaration = location.parent;
157995
158077
  const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, (declaration) => declaration === (location.kind === 135 /* ConstructorKeyword */ ? functionDeclaration.parent : functionDeclaration));
157996
158078
  if (locationIsSymbolDeclaration) {
@@ -160328,18 +160410,12 @@ ${options.prefix}` : "\n" : options.prefix
160328
160410
  rule("NoSpaceBetweenCloseParenAndAngularBracket", 21 /* CloseParenToken */, 29 /* LessThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */),
160329
160411
  rule("NoSpaceAfterOpenAngularBracket", 29 /* LessThanToken */, anyToken, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */),
160330
160412
  rule("NoSpaceBeforeCloseAngularBracket", anyToken, 31 /* GreaterThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 16 /* DeleteSpace */),
160331
- rule(
160332
- "NoSpaceAfterCloseAngularBracket",
160333
- 31 /* GreaterThanToken */,
160334
- [20 /* OpenParenToken */, 22 /* OpenBracketToken */, 31 /* GreaterThanToken */, 27 /* CommaToken */],
160335
- [
160336
- isNonJsxSameLineTokenContext,
160337
- isTypeArgumentOrParameterOrAssertionContext,
160338
- isNotFunctionDeclContext
160339
- /*To prevent an interference with the SpaceBeforeOpenParenInFuncDecl rule*/
160340
- ],
160341
- 16 /* DeleteSpace */
160342
- ),
160413
+ rule("NoSpaceAfterCloseAngularBracket", 31 /* GreaterThanToken */, [20 /* OpenParenToken */, 22 /* OpenBracketToken */, 31 /* GreaterThanToken */, 27 /* CommaToken */], [
160414
+ isNonJsxSameLineTokenContext,
160415
+ isTypeArgumentOrParameterOrAssertionContext,
160416
+ isNotFunctionDeclContext,
160417
+ isNonTypeAssertionContext
160418
+ ], 16 /* DeleteSpace */),
160343
160419
  // decorators
160344
160420
  rule("SpaceBeforeAt", [21 /* CloseParenToken */, 79 /* Identifier */], 59 /* AtToken */, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */),
160345
160421
  rule("NoSpaceAfterAt", 59 /* AtToken */, anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),
@@ -160772,6 +160848,9 @@ ${options.prefix}` : "\n" : options.prefix
160772
160848
  function isTypeAssertionContext(context) {
160773
160849
  return context.contextNode.kind === 213 /* TypeAssertionExpression */;
160774
160850
  }
160851
+ function isNonTypeAssertionContext(context) {
160852
+ return !isTypeAssertionContext(context);
160853
+ }
160775
160854
  function isVoidOpContext(context) {
160776
160855
  return context.currentTokenSpan.kind === 114 /* VoidKeyword */ && context.currentTokenParent.kind === 219 /* VoidExpression */;
160777
160856
  }
@@ -165751,6 +165830,7 @@ ${options.prefix}` : "\n" : options.prefix
165751
165830
  isNonContextualKeyword: () => isNonContextualKeyword,
165752
165831
  isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
165753
165832
  isNonGlobalDeclaration: () => isNonGlobalDeclaration,
165833
+ isNonNullAccess: () => isNonNullAccess,
165754
165834
  isNonNullChain: () => isNonNullChain,
165755
165835
  isNonNullExpression: () => isNonNullExpression,
165756
165836
  isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName,