typescript 5.0.0-dev.20230131 → 5.0.0-dev.20230202

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.
Files changed (84) hide show
  1. package/lib/lib.d.ts +0 -2
  2. package/lib/lib.decorators.d.ts +0 -2
  3. package/lib/lib.decorators.legacy.d.ts +0 -2
  4. package/lib/lib.dom.d.ts +0 -2
  5. package/lib/lib.dom.iterable.d.ts +0 -2
  6. package/lib/lib.es2015.collection.d.ts +0 -2
  7. package/lib/lib.es2015.core.d.ts +0 -2
  8. package/lib/lib.es2015.d.ts +0 -2
  9. package/lib/lib.es2015.generator.d.ts +0 -2
  10. package/lib/lib.es2015.iterable.d.ts +0 -2
  11. package/lib/lib.es2015.promise.d.ts +0 -2
  12. package/lib/lib.es2015.proxy.d.ts +0 -2
  13. package/lib/lib.es2015.reflect.d.ts +0 -2
  14. package/lib/lib.es2015.symbol.d.ts +0 -2
  15. package/lib/lib.es2015.symbol.wellknown.d.ts +0 -2
  16. package/lib/lib.es2016.array.include.d.ts +0 -2
  17. package/lib/lib.es2016.d.ts +0 -2
  18. package/lib/lib.es2016.full.d.ts +0 -2
  19. package/lib/lib.es2017.d.ts +0 -2
  20. package/lib/lib.es2017.full.d.ts +0 -2
  21. package/lib/lib.es2017.intl.d.ts +0 -2
  22. package/lib/lib.es2017.object.d.ts +0 -2
  23. package/lib/lib.es2017.sharedmemory.d.ts +0 -2
  24. package/lib/lib.es2017.string.d.ts +0 -2
  25. package/lib/lib.es2017.typedarrays.d.ts +0 -2
  26. package/lib/lib.es2018.asyncgenerator.d.ts +0 -2
  27. package/lib/lib.es2018.asynciterable.d.ts +0 -2
  28. package/lib/lib.es2018.d.ts +0 -2
  29. package/lib/lib.es2018.full.d.ts +0 -2
  30. package/lib/lib.es2018.intl.d.ts +0 -2
  31. package/lib/lib.es2018.promise.d.ts +0 -2
  32. package/lib/lib.es2018.regexp.d.ts +0 -2
  33. package/lib/lib.es2019.array.d.ts +0 -2
  34. package/lib/lib.es2019.d.ts +0 -2
  35. package/lib/lib.es2019.full.d.ts +0 -2
  36. package/lib/lib.es2019.intl.d.ts +0 -2
  37. package/lib/lib.es2019.object.d.ts +0 -2
  38. package/lib/lib.es2019.string.d.ts +0 -2
  39. package/lib/lib.es2019.symbol.d.ts +0 -2
  40. package/lib/lib.es2020.bigint.d.ts +0 -2
  41. package/lib/lib.es2020.d.ts +0 -2
  42. package/lib/lib.es2020.date.d.ts +0 -2
  43. package/lib/lib.es2020.full.d.ts +0 -2
  44. package/lib/lib.es2020.intl.d.ts +0 -2
  45. package/lib/lib.es2020.number.d.ts +0 -2
  46. package/lib/lib.es2020.promise.d.ts +0 -2
  47. package/lib/lib.es2020.sharedmemory.d.ts +0 -2
  48. package/lib/lib.es2020.string.d.ts +0 -2
  49. package/lib/lib.es2020.symbol.wellknown.d.ts +0 -2
  50. package/lib/lib.es2021.d.ts +0 -2
  51. package/lib/lib.es2021.full.d.ts +0 -2
  52. package/lib/lib.es2021.intl.d.ts +0 -2
  53. package/lib/lib.es2021.promise.d.ts +0 -2
  54. package/lib/lib.es2021.string.d.ts +0 -2
  55. package/lib/lib.es2021.weakref.d.ts +0 -2
  56. package/lib/lib.es2022.array.d.ts +0 -2
  57. package/lib/lib.es2022.d.ts +0 -2
  58. package/lib/lib.es2022.error.d.ts +0 -2
  59. package/lib/lib.es2022.full.d.ts +0 -2
  60. package/lib/lib.es2022.intl.d.ts +0 -2
  61. package/lib/lib.es2022.object.d.ts +0 -2
  62. package/lib/lib.es2022.regexp.d.ts +0 -2
  63. package/lib/lib.es2022.sharedmemory.d.ts +0 -2
  64. package/lib/lib.es2022.string.d.ts +0 -2
  65. package/lib/lib.es2023.array.d.ts +0 -2
  66. package/lib/lib.es2023.d.ts +0 -2
  67. package/lib/lib.es2023.full.d.ts +0 -2
  68. package/lib/lib.es5.d.ts +0 -2
  69. package/lib/lib.es6.d.ts +0 -2
  70. package/lib/lib.esnext.d.ts +0 -2
  71. package/lib/lib.esnext.full.d.ts +0 -2
  72. package/lib/lib.esnext.intl.d.ts +0 -2
  73. package/lib/lib.scripthost.d.ts +0 -2
  74. package/lib/lib.webworker.d.ts +0 -2
  75. package/lib/lib.webworker.importscripts.d.ts +0 -2
  76. package/lib/lib.webworker.iterable.d.ts +0 -2
  77. package/lib/tsc.js +43 -23
  78. package/lib/tsserver.js +55 -29
  79. package/lib/tsserverlibrary.d.ts +16 -0
  80. package/lib/tsserverlibrary.js +55 -29
  81. package/lib/typescript.d.ts +16 -0
  82. package/lib/typescript.js +55 -29
  83. package/lib/typingsInstaller.js +5 -4
  84. package/package.json +1 -1
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.0";
38
- version = `${versionMajorMinor}.0-dev.20230131`;
38
+ version = `${versionMajorMinor}.0-dev.20230202`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7338,7 +7338,6 @@ ${lanes.join("\n")}
7338
7338
  Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
7339
7339
  Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
7340
7340
  Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."),
7341
- Type_arguments_cannot_be_used_here: diag(1342, 1 /* Error */, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
7342
7341
  The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),
7343
7342
  A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
7344
7343
  An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
@@ -7984,7 +7983,7 @@ ${lanes.join("\n")}
7984
7983
  Private_accessor_was_defined_without_a_getter: diag(2806, 1 /* Error */, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."),
7985
7984
  This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),
7986
7985
  A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1 /* Error */, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"),
7987
- Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."),
7986
+ Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."),
7988
7987
  Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1 /* Error */, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),
7989
7988
  Initializer_for_property_0: diag(2811, 1 /* Error */, "Initializer_for_property_0_2811", "Initializer for property '{0}'"),
7990
7989
  Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),
@@ -8722,6 +8721,7 @@ ${lanes.join("\n")}
8722
8721
  new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),
8723
8722
  _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),
8724
8723
  Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),
8724
+ This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."),
8725
8725
  Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),
8726
8726
  Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),
8727
8727
  Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."),
@@ -18251,7 +18251,7 @@ ${lanes.join("\n")}
18251
18251
  }
18252
18252
  function rangeOfTypeParameters(sourceFile, typeParameters) {
18253
18253
  const pos = typeParameters.pos - 1;
18254
- const end = skipTrivia(sourceFile.text, typeParameters.end) + 1;
18254
+ const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1);
18255
18255
  return { pos, end };
18256
18256
  }
18257
18257
  function skipTypeChecking(sourceFile, options, host) {
@@ -30997,6 +30997,7 @@ ${lanes.join("\n")}
30997
30997
  switch (fourth) {
30998
30998
  case 63 /* EqualsToken */:
30999
30999
  case 31 /* GreaterThanToken */:
31000
+ case 43 /* SlashToken */:
31000
31001
  return false;
31001
31002
  default:
31002
31003
  return true;
@@ -32051,7 +32052,7 @@ ${lanes.join("\n")}
32051
32052
  parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition);
32052
32053
  const result = withJSDoc(finishNode(factory2.createBlock(statements, multiLine), pos), hasJSDoc);
32053
32054
  if (token() === 63 /* EqualsToken */) {
32054
- parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses);
32055
+ parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses);
32055
32056
  nextToken();
32056
32057
  }
32057
32058
  return result;
@@ -44305,8 +44306,10 @@ ${lanes.join("\n")}
44305
44306
  const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
44306
44307
  const importMode = overrideMode || importingSourceFile.impliedNodeFormat;
44307
44308
  if (getResolvePackageJsonExports(options)) {
44309
+ const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1);
44310
+ const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2);
44308
44311
  const conditions = getConditions(options, importMode === 99 /* ESNext */);
44309
- const fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string" ? tryGetModuleNameFromExports(options, path, packageRootPath, getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions) : void 0;
44312
+ const fromExports = packageJsonContent.exports ? tryGetModuleNameFromExports(options, path, packageRootPath, packageName2, packageJsonContent.exports, conditions) : void 0;
44310
44313
  if (fromExports) {
44311
44314
  const withJsExtension = !hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
44312
44315
  return { ...withJsExtension, verbatimFromExports: true };
@@ -55970,6 +55973,12 @@ ${lanes.join("\n")}
55970
55973
  thisParameter = getAnnotatedAccessorThisParameter(other);
55971
55974
  }
55972
55975
  }
55976
+ if (isInJSFile(declaration)) {
55977
+ const thisTag = getJSDocThisTag(declaration);
55978
+ if (thisTag && thisTag.typeExpression) {
55979
+ thisParameter = createSymbolWithType(createSymbol(1 /* FunctionScopedVariable */, "this" /* This */), getTypeFromTypeNode(thisTag.typeExpression));
55980
+ }
55981
+ }
55973
55982
  const classType = declaration.kind === 173 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0;
55974
55983
  const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
55975
55984
  if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {
@@ -56083,7 +56092,11 @@ ${lanes.join("\n")}
56083
56092
  if (node.tags) {
56084
56093
  for (const tag of node.tags) {
56085
56094
  if (isJSDocOverloadTag(tag)) {
56086
- result.push(getSignatureFromDeclaration(tag.typeExpression));
56095
+ const jsDocSignature = tag.typeExpression;
56096
+ if (jsDocSignature.type === void 0) {
56097
+ reportImplicitAny(jsDocSignature, anyType);
56098
+ }
56099
+ result.push(getSignatureFromDeclaration(jsDocSignature));
56087
56100
  hasJSDocOverloads = true;
56088
56101
  }
56089
56102
  }
@@ -57782,7 +57795,7 @@ ${lanes.join("\n")}
57782
57795
  function typePredicateKindsMatch(a, b) {
57783
57796
  return a.kind === b.kind && a.parameterIndex === b.parameterIndex;
57784
57797
  }
57785
- function getUnionTypeFromSortedList(types, objectFlags, aliasSymbol, aliasTypeArguments, origin) {
57798
+ function getUnionTypeFromSortedList(types, precomputedObjectFlags, aliasSymbol, aliasTypeArguments, origin) {
57786
57799
  if (types.length === 0) {
57787
57800
  return neverType;
57788
57801
  }
@@ -57794,7 +57807,7 @@ ${lanes.join("\n")}
57794
57807
  let type = unionTypes.get(id);
57795
57808
  if (!type) {
57796
57809
  type = createType(1048576 /* Union */);
57797
- type.objectFlags = objectFlags | getPropagatingFlagsOfTypes(
57810
+ type.objectFlags = precomputedObjectFlags | getPropagatingFlagsOfTypes(
57798
57811
  types,
57799
57812
  /*excludeKinds*/
57800
57813
  98304 /* Nullable */
@@ -58971,11 +58984,6 @@ ${lanes.join("\n")}
58971
58984
  var _a2;
58972
58985
  const links = getNodeLinks(node);
58973
58986
  if (!links.resolvedType) {
58974
- if (node.isTypeOf && node.typeArguments) {
58975
- error(node, Diagnostics.Type_arguments_cannot_be_used_here);
58976
- links.resolvedSymbol = unknownSymbol;
58977
- return links.resolvedType = errorType;
58978
- }
58979
58987
  if (!isLiteralImportTypeNode(node)) {
58980
58988
  error(node.argument, Diagnostics.String_literal_expected);
58981
58989
  links.resolvedSymbol = unknownSymbol;
@@ -59036,7 +59044,7 @@ ${lanes.join("\n")}
59036
59044
  const resolvedSymbol = resolveSymbol(symbol);
59037
59045
  links.resolvedSymbol = resolvedSymbol;
59038
59046
  if (meaning === 111551 /* Value */) {
59039
- return getTypeOfSymbol(symbol);
59047
+ return getInstantiationExpressionType(getTypeOfSymbol(symbol), node);
59040
59048
  } else {
59041
59049
  const type = tryGetDeclaredTypeOfSymbol(resolvedSymbol);
59042
59050
  const typeParameters = type && getTypeParametersForTypeAndSymbol(type, resolvedSymbol);
@@ -61114,7 +61122,8 @@ ${lanes.join("\n")}
61114
61122
  Debug.assert(!isTypeAssignableTo(generalizedSource, target2), "generalized source shouldn't be assignable");
61115
61123
  generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource);
61116
61124
  }
61117
- if (target2.flags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) {
61125
+ const targetFlags = target2.flags & 8388608 /* IndexedAccess */ && !(source2.flags & 8388608 /* IndexedAccess */) ? target2.objectType.flags : target2.flags;
61126
+ if (targetFlags & 262144 /* TypeParameter */ && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) {
61118
61127
  const constraint = getBaseConstraintOfType(target2);
61119
61128
  let needsOriginalSource;
61120
61129
  if (constraint && (isTypeAssignableTo(generalizedSource, constraint) || (needsOriginalSource = isTypeAssignableTo(source2, constraint)))) {
@@ -64032,6 +64041,11 @@ ${lanes.join("\n")}
64032
64041
  case 320 /* JSDocFunctionType */:
64033
64042
  error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
64034
64043
  return;
64044
+ case 326 /* JSDocSignature */:
64045
+ if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) {
64046
+ error(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString);
64047
+ }
64048
+ return;
64035
64049
  case 259 /* FunctionDeclaration */:
64036
64050
  case 171 /* MethodDeclaration */:
64037
64051
  case 170 /* MethodSignature */:
@@ -65777,7 +65791,7 @@ ${lanes.join("\n")}
65777
65791
  }
65778
65792
  return getUnionTypeFromSortedList(
65779
65793
  filtered,
65780
- type.objectFlags,
65794
+ type.objectFlags & (32768 /* PrimitiveUnion */ | 16777216 /* ContainsIntersections */),
65781
65795
  /*aliasSymbol*/
65782
65796
  void 0,
65783
65797
  /*aliasTypeArguments*/
@@ -67119,7 +67133,7 @@ ${lanes.join("\n")}
67119
67133
  }
67120
67134
  }
67121
67135
  function getTypeOfSymbolAtLocation(symbol, location) {
67122
- symbol = symbol.exportSymbol || symbol;
67136
+ symbol = getExportSymbolOfValueSymbolIfExported(symbol);
67123
67137
  if (location.kind === 79 /* Identifier */ || location.kind === 80 /* PrivateIdentifier */) {
67124
67138
  if (isRightSideOfQualifiedNameOrPropertyAccess(location)) {
67125
67139
  location = location.parent;
@@ -72759,6 +72773,9 @@ ${lanes.join("\n")}
72759
72773
  checkGrammarExpressionWithTypeArguments(node);
72760
72774
  forEach(node.typeArguments, checkSourceElement);
72761
72775
  const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
72776
+ return getInstantiationExpressionType(exprType, node);
72777
+ }
72778
+ function getInstantiationExpressionType(exprType, node) {
72762
72779
  const typeArguments = node.typeArguments;
72763
72780
  if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
72764
72781
  return exprType;
@@ -75397,7 +75414,7 @@ ${lanes.join("\n")}
75397
75414
  return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
75398
75415
  } else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
75399
75416
  return getTypeFromTypeNode(expr.type);
75400
- } else if (node.kind === 8 /* NumericLiteral */ || node.kind === 10 /* StringLiteral */ || node.kind === 110 /* TrueKeyword */ || node.kind === 95 /* FalseKeyword */) {
75417
+ } else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
75401
75418
  return checkExpression(node);
75402
75419
  }
75403
75420
  return void 0;
@@ -81310,7 +81327,7 @@ ${lanes.join("\n")}
81310
81327
  }
81311
81328
  return node.parent.kind === 180 /* TypeReference */;
81312
81329
  }
81313
- function isHeritageClauseElementIdentifier(node) {
81330
+ function isInNameOfExpressionWithTypeArguments(node) {
81314
81331
  while (node.parent.kind === 208 /* PropertyAccessExpression */) {
81315
81332
  node = node.parent;
81316
81333
  }
@@ -81420,10 +81437,10 @@ ${lanes.join("\n")}
81420
81437
  while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name)) {
81421
81438
  name = name.parent;
81422
81439
  }
81423
- if (isHeritageClauseElementIdentifier(name)) {
81440
+ if (isInNameOfExpressionWithTypeArguments(name)) {
81424
81441
  let meaning = 0 /* None */;
81425
81442
  if (name.parent.kind === 230 /* ExpressionWithTypeArguments */) {
81426
- meaning = 788968 /* Type */;
81443
+ meaning = isPartOfTypeNode(name) ? 788968 /* Type */ : 111551 /* Value */;
81427
81444
  if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) {
81428
81445
  meaning |= 111551 /* Value */;
81429
81446
  }
@@ -106718,7 +106735,7 @@ ${lanes.join("\n")}
106718
106735
  if (elem.kind === 229 /* OmittedExpression */) {
106719
106736
  return elem;
106720
106737
  }
106721
- if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced) {
106738
+ if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !elem.symbol.isReferenced && !isIdentifierANonContextualKeyword(elem.propertyName)) {
106722
106739
  return factory2.updateBindingElement(
106723
106740
  elem,
106724
106741
  elem.dotDotDotToken,
@@ -126516,7 +126533,7 @@ ${lanes.join("\n")}
126516
126533
  };
126517
126534
  }
126518
126535
  function moduleResolutionUsesNodeModules(moduleResolution) {
126519
- return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */;
126536
+ return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
126520
126537
  }
126521
126538
  function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) {
126522
126539
  return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0;
@@ -150308,12 +150325,12 @@ ${lanes.join("\n")}
150308
150325
  const mode = isStringLiteralLike(node) ? getModeForUsageLocation(sourceFile, node) : void 0;
150309
150326
  const scriptPath = sourceFile.path;
150310
150327
  const scriptDirectory = getDirectoryPath(scriptPath);
150311
- const extensionOptions = getExtensionOptions(compilerOptions, ReferenceKind.ModuleSpecifier, sourceFile, preferences, mode);
150328
+ const extensionOptions = getExtensionOptions(compilerOptions, ReferenceKind.ModuleSpecifier, sourceFile, typeChecker, preferences, mode);
150312
150329
  return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && (isRootedDiskPath(literalValue) || isUrl(literalValue)) ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath, extensionOptions) : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, mode, compilerOptions, host, extensionOptions, typeChecker);
150313
150330
  }
150314
- function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile, preferences, resolutionMode) {
150331
+ function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile, typeChecker, preferences, resolutionMode) {
150315
150332
  return {
150316
- extensionsToSearch: flatten(getSupportedExtensionsForModuleResolution(compilerOptions)),
150333
+ extensionsToSearch: flatten(getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker)),
150317
150334
  referenceKind,
150318
150335
  importingSourceFile,
150319
150336
  endingPreference: preferences == null ? void 0 : preferences.importModuleSpecifierEnding,
@@ -150343,8 +150360,17 @@ ${lanes.join("\n")}
150343
150360
  ).values());
150344
150361
  }
150345
150362
  }
150346
- function getSupportedExtensionsForModuleResolution(compilerOptions) {
150347
- const extensions = getSupportedExtensions(compilerOptions);
150363
+ function getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker) {
150364
+ const ambientModulesExtensions = !typeChecker ? [] : mapDefined(
150365
+ typeChecker.getAmbientModules(),
150366
+ (module2) => {
150367
+ const name = module2.name.slice(1, -1);
150368
+ if (!name.startsWith("*.") || name.includes("/"))
150369
+ return;
150370
+ return name.slice(1);
150371
+ }
150372
+ );
150373
+ const extensions = [...getSupportedExtensions(compilerOptions), ambientModulesExtensions];
150348
150374
  const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
150349
150375
  return moduleResolutionUsesNodeModules(moduleResolution) ? getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions) : extensions;
150350
150376
  }
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.0";
57
- var version = `${versionMajorMinor}.0-dev.20230131`;
57
+ var version = `${versionMajorMinor}.0-dev.20230202`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -5459,7 +5459,6 @@ var Diagnostics = {
5459
5459
  Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
5460
5460
  Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
5461
5461
  Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."),
5462
- Type_arguments_cannot_be_used_here: diag(1342, 1 /* Error */, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
5463
5462
  The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),
5464
5463
  A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
5465
5464
  An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
@@ -6105,7 +6104,7 @@ var Diagnostics = {
6105
6104
  Private_accessor_was_defined_without_a_getter: diag(2806, 1 /* Error */, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."),
6106
6105
  This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),
6107
6106
  A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1 /* Error */, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"),
6108
- Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."),
6107
+ Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."),
6109
6108
  Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1 /* Error */, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),
6110
6109
  Initializer_for_property_0: diag(2811, 1 /* Error */, "Initializer_for_property_0_2811", "Initializer for property '{0}'"),
6111
6110
  Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),
@@ -6843,6 +6842,7 @@ var Diagnostics = {
6843
6842
  new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),
6844
6843
  _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),
6845
6844
  Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),
6845
+ This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1 /* Error */, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."),
6846
6846
  Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),
6847
6847
  Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),
6848
6848
  Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."),
@@ -21810,6 +21810,7 @@ var Parser;
21810
21810
  switch (fourth) {
21811
21811
  case 63 /* EqualsToken */:
21812
21812
  case 31 /* GreaterThanToken */:
21813
+ case 43 /* SlashToken */:
21813
21814
  return false;
21814
21815
  default:
21815
21816
  return true;
@@ -22864,7 +22865,7 @@ var Parser;
22864
22865
  parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition);
22865
22866
  const result = withJSDoc(finishNode(factory2.createBlock(statements, multiLine), pos), hasJSDoc);
22866
22867
  if (token() === 63 /* EqualsToken */) {
22867
- parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses);
22868
+ parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses);
22868
22869
  nextToken();
22869
22870
  }
22870
22871
  return result;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.0.0-dev.20230131",
5
+ "version": "5.0.0-dev.20230202",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [