@typescript-deploys/pr-build 5.2.0-pr-54536-13 → 5.2.0-pr-54281-18
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/lib.es2023.array.d.ts +36 -618
- package/lib/tsc.js +45 -51
- package/lib/tsserver.js +250 -200
- package/lib/tsserverlibrary.js +268 -209
- package/lib/typescript.js +268 -209
- package/lib/typingsInstaller.js +10 -13
- package/package.json +2 -3
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.2";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230607`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -5986,6 +5986,8 @@ var Diagnostics = {
|
|
|
5986
5986
|
Class_constructor_may_not_be_a_generator: diag(1368, 1 /* Error */, "Class_constructor_may_not_be_a_generator_1368", "Class constructor may not be a generator."),
|
|
5987
5987
|
Did_you_mean_0: diag(1369, 3 /* Message */, "Did_you_mean_0_1369", "Did you mean '{0}'?"),
|
|
5988
5988
|
This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error: diag(1371, 1 /* Error */, "This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371", "This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."),
|
|
5989
|
+
Convert_to_type_only_import: diag(1373, 3 /* Message */, "Convert_to_type_only_import_1373", "Convert to type-only import"),
|
|
5990
|
+
Convert_all_imports_not_used_as_a_value_to_type_only_imports: diag(1374, 3 /* Message */, "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374", "Convert all imports not used as a value to type-only imports"),
|
|
5989
5991
|
await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1 /* Error */, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
5990
5992
|
_0_was_imported_here: diag(1376, 3 /* Message */, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
5991
5993
|
_0_was_exported_here: diag(1377, 3 /* Message */, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
@@ -7191,8 +7193,6 @@ var Diagnostics = {
|
|
|
7191
7193
|
Resolved_under_condition_0: diag(6414, 3 /* Message */, "Resolved_under_condition_0_6414", "Resolved under condition '{0}'."),
|
|
7192
7194
|
Failed_to_resolve_under_condition_0: diag(6415, 3 /* Message */, "Failed_to_resolve_under_condition_0_6415", "Failed to resolve under condition '{0}'."),
|
|
7193
7195
|
Exiting_conditional_exports: diag(6416, 3 /* Message */, "Exiting_conditional_exports_6416", "Exiting conditional exports."),
|
|
7194
|
-
Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0: diag(6417, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417", "Searching all ancestor node_modules directories for preferred extensions: {0}."),
|
|
7195
|
-
Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0: diag(6418, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418", "Searching all ancestor node_modules directories for fallback extensions: {0}."),
|
|
7196
7196
|
The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
|
|
7197
7197
|
The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
|
|
7198
7198
|
The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
|
|
@@ -7705,9 +7705,9 @@ var Diagnostics = {
|
|
|
7705
7705
|
Convert_all_typedef_to_TypeScript_types: diag(95177, 3 /* Message */, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."),
|
|
7706
7706
|
Move_to_file: diag(95178, 3 /* Message */, "Move_to_file_95178", "Move to file"),
|
|
7707
7707
|
Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3 /* Message */, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"),
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7708
|
+
Inline_variable: diag(95180, 3 /* Message */, "Inline_variable_95180", "Inline variable"),
|
|
7709
|
+
Could_not_find_variable_to_inline: diag(95181, 3 /* Message */, "Could_not_find_variable_to_inline_95181", "Could not find variable to inline."),
|
|
7710
|
+
Variables_that_share_a_name_with_a_type_or_namespace_in_the_same_scope_cannot_be_inlined: diag(95182, 3 /* Message */, "Variables_that_share_a_name_with_a_type_or_namespace_in_the_same_scope_cannot_be_inlined_95182", "Variables that share a name with a type or namespace in the same scope cannot be inlined."),
|
|
7711
7711
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
7712
7712
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
7713
7713
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -38486,13 +38486,11 @@ function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName,
|
|
|
38486
38486
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
38487
38487
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
38488
38488
|
if (priorityExtensions) {
|
|
38489
|
-
traceIfEnabled(state, Diagnostics.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0, formatExtensions(priorityExtensions));
|
|
38490
38489
|
const result = lookup(priorityExtensions);
|
|
38491
38490
|
if (result)
|
|
38492
38491
|
return result;
|
|
38493
38492
|
}
|
|
38494
38493
|
if (secondaryExtensions && !typesScopeOnly) {
|
|
38495
|
-
traceIfEnabled(state, Diagnostics.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0, formatExtensions(secondaryExtensions));
|
|
38496
38494
|
return lookup(secondaryExtensions);
|
|
38497
38495
|
}
|
|
38498
38496
|
function lookup(extensions2) {
|
|
@@ -42658,11 +42656,10 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
|
|
|
42658
42656
|
CheckMode3[CheckMode3["Inferential"] = 2] = "Inferential";
|
|
42659
42657
|
CheckMode3[CheckMode3["SkipContextSensitive"] = 4] = "SkipContextSensitive";
|
|
42660
42658
|
CheckMode3[CheckMode3["SkipGenericFunctions"] = 8] = "SkipGenericFunctions";
|
|
42661
|
-
CheckMode3[CheckMode3["
|
|
42662
|
-
CheckMode3[CheckMode3["
|
|
42663
|
-
CheckMode3[CheckMode3["
|
|
42664
|
-
CheckMode3[CheckMode3["
|
|
42665
|
-
CheckMode3[CheckMode3["TypeOnly"] = 256] = "TypeOnly";
|
|
42659
|
+
CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
|
|
42660
|
+
CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
|
|
42661
|
+
CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
|
|
42662
|
+
CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
|
|
42666
42663
|
return CheckMode3;
|
|
42667
42664
|
})(CheckMode || {});
|
|
42668
42665
|
var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
@@ -42942,9 +42939,9 @@ function createTypeChecker(host) {
|
|
|
42942
42939
|
candidatesOutArray,
|
|
42943
42940
|
/*argumentCount*/
|
|
42944
42941
|
void 0,
|
|
42945
|
-
|
|
42942
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
42946
42943
|
)),
|
|
42947
|
-
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount,
|
|
42944
|
+
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
42948
42945
|
getExpandedParameters,
|
|
42949
42946
|
hasEffectiveRestParameter,
|
|
42950
42947
|
containsArgumentsReference,
|
|
@@ -50899,7 +50896,7 @@ function createTypeChecker(host) {
|
|
|
50899
50896
|
return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
|
|
50900
50897
|
}
|
|
50901
50898
|
function getTypeForBindingElement(declaration) {
|
|
50902
|
-
const checkMode = declaration.dotDotDotToken ?
|
|
50899
|
+
const checkMode = declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */;
|
|
50903
50900
|
const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
|
|
50904
50901
|
return parentType && getBindingElementTypeFromParentType(declaration, parentType);
|
|
50905
50902
|
}
|
|
@@ -52656,13 +52653,19 @@ function createTypeChecker(host) {
|
|
|
52656
52653
|
if (getObjectFlags(type) & 4 /* Reference */) {
|
|
52657
52654
|
const target = type.target;
|
|
52658
52655
|
const typeArguments = getTypeArguments(type);
|
|
52659
|
-
|
|
52656
|
+
if (length(target.typeParameters) === length(typeArguments)) {
|
|
52657
|
+
const ref = createTypeReference(target, concatenate(typeArguments, [thisArgument || target.thisType]));
|
|
52658
|
+
return needApparentType ? getApparentType(ref) : ref;
|
|
52659
|
+
}
|
|
52660
52660
|
} else if (type.flags & 2097152 /* Intersection */) {
|
|
52661
52661
|
const types = sameMap(type.types, (t) => getTypeWithThisArgument(t, thisArgument, needApparentType));
|
|
52662
52662
|
return types !== type.types ? getIntersectionType(types) : type;
|
|
52663
52663
|
}
|
|
52664
52664
|
return needApparentType ? getApparentType(type) : type;
|
|
52665
52665
|
}
|
|
52666
|
+
function getThisArgument(type) {
|
|
52667
|
+
return getObjectFlags(type) & 4 /* Reference */ && length(getTypeArguments(type)) > getTypeReferenceArity(type) ? last(getTypeArguments(type)) : type;
|
|
52668
|
+
}
|
|
52666
52669
|
function resolveObjectTypeMembers(type, source, typeParameters, typeArguments) {
|
|
52667
52670
|
let mapper;
|
|
52668
52671
|
let members;
|
|
@@ -53728,7 +53731,7 @@ function createTypeChecker(host) {
|
|
|
53728
53731
|
return type.resolvedBaseConstraint;
|
|
53729
53732
|
}
|
|
53730
53733
|
const stack = [];
|
|
53731
|
-
return type.resolvedBaseConstraint = getImmediateBaseConstraint(type);
|
|
53734
|
+
return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), getThisArgument(type));
|
|
53732
53735
|
function getImmediateBaseConstraint(t) {
|
|
53733
53736
|
if (!t.immediateBaseConstraint) {
|
|
53734
53737
|
if (!pushTypeResolution(t, 4 /* ImmediateBaseConstraint */)) {
|
|
@@ -53820,18 +53823,18 @@ function createTypeChecker(host) {
|
|
|
53820
53823
|
}
|
|
53821
53824
|
if (isGenericTupleType(t)) {
|
|
53822
53825
|
const newElements = map(getElementTypes(t), (v, i) => {
|
|
53823
|
-
const constraint =
|
|
53824
|
-
return constraint
|
|
53826
|
+
const constraint = t.target.elementFlags[i] & 8 /* Variadic */ && getBaseConstraint(v) || v;
|
|
53827
|
+
return constraint && everyType(constraint, (c) => isArrayOrTupleType(c) && !isGenericTupleType(c)) ? constraint : v;
|
|
53825
53828
|
});
|
|
53826
53829
|
return createTupleType(newElements, t.target.elementFlags, t.target.readonly, t.target.labeledElementDeclarations);
|
|
53827
53830
|
}
|
|
53828
53831
|
return t;
|
|
53829
53832
|
}
|
|
53830
53833
|
}
|
|
53831
|
-
function getApparentTypeOfIntersectionType(type
|
|
53834
|
+
function getApparentTypeOfIntersectionType(type) {
|
|
53832
53835
|
return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(
|
|
53833
53836
|
type,
|
|
53834
|
-
|
|
53837
|
+
type,
|
|
53835
53838
|
/*needApparentType*/
|
|
53836
53839
|
true
|
|
53837
53840
|
));
|
|
@@ -53882,9 +53885,8 @@ function createTypeChecker(host) {
|
|
|
53882
53885
|
return !!(type.flags & 8388608 /* IndexedAccess */ && getObjectFlags(objectType = type.objectType) & 32 /* Mapped */ && !isGenericMappedType(objectType) && isGenericIndexType(type.indexType) && !(getMappedTypeModifiers(objectType) & 8 /* ExcludeOptional */) && !objectType.declaration.nameType);
|
|
53883
53886
|
}
|
|
53884
53887
|
function getApparentType(type) {
|
|
53885
|
-
const t = type.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType
|
|
53886
|
-
|
|
53887
|
-
return objectFlags & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : objectFlags & 4 /* Reference */ && t !== type ? getTypeWithThisArgument(t, type) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t, type) : t.flags & 402653316 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType() : t.flags & 528 /* BooleanLike */ ? globalBooleanType : t.flags & 12288 /* ESSymbolLike */ ? getGlobalESSymbolType() : t.flags & 67108864 /* NonPrimitive */ ? emptyObjectType : t.flags & 4194304 /* Index */ ? keyofConstraintType : t.flags & 2 /* Unknown */ && !strictNullChecks ? emptyObjectType : t;
|
|
53888
|
+
const t = !(type.flags & 465829888 /* Instantiable */) ? type : getBaseConstraintOfType(type) || unknownType;
|
|
53889
|
+
return getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 402653316 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType() : t.flags & 528 /* BooleanLike */ ? globalBooleanType : t.flags & 12288 /* ESSymbolLike */ ? getGlobalESSymbolType() : t.flags & 67108864 /* NonPrimitive */ ? emptyObjectType : t.flags & 4194304 /* Index */ ? keyofConstraintType : t.flags & 2 /* Unknown */ && !strictNullChecks ? emptyObjectType : t;
|
|
53888
53890
|
}
|
|
53889
53891
|
function getReducedApparentType(type) {
|
|
53890
53892
|
return getReducedType(getApparentType(getReducedType(type)));
|
|
@@ -60705,7 +60707,7 @@ function createTypeChecker(host) {
|
|
|
60705
60707
|
return 3 /* Maybe */;
|
|
60706
60708
|
}
|
|
60707
60709
|
const c = target2;
|
|
60708
|
-
if (!c.root.inferTypeParameters && !isDistributionDependent(c.root)
|
|
60710
|
+
if (!c.root.inferTypeParameters && !isDistributionDependent(c.root)) {
|
|
60709
60711
|
const skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
|
|
60710
60712
|
const skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
|
|
60711
60713
|
if (result2 = skipTrue ? -1 /* True */ : isRelatedTo(
|
|
@@ -64715,8 +64717,6 @@ function createTypeChecker(host) {
|
|
|
64715
64717
|
}
|
|
64716
64718
|
function isConstantReference(node) {
|
|
64717
64719
|
switch (node.kind) {
|
|
64718
|
-
case 110 /* ThisKeyword */:
|
|
64719
|
-
return true;
|
|
64720
64720
|
case 80 /* Identifier */:
|
|
64721
64721
|
if (!isThisInTypeQuery(node)) {
|
|
64722
64722
|
const symbol = getResolvedSymbol(node);
|
|
@@ -65791,7 +65791,7 @@ function createTypeChecker(host) {
|
|
|
65791
65791
|
return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithoutNullableConstraint) : !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */));
|
|
65792
65792
|
}
|
|
65793
65793
|
function hasContextualTypeWithNoGenericTypes(node, checkMode) {
|
|
65794
|
-
const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode &
|
|
65794
|
+
const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 64 /* RestBindingElement */ ? getContextualType(node, 8 /* SkipBindingPatterns */) : getContextualType(
|
|
65795
65795
|
node,
|
|
65796
65796
|
/*contextFlags*/
|
|
65797
65797
|
void 0
|
|
@@ -66548,7 +66548,7 @@ function createTypeChecker(host) {
|
|
|
66548
66548
|
function getContextualTypeForBindingElement(declaration, contextFlags) {
|
|
66549
66549
|
const parent = declaration.parent.parent;
|
|
66550
66550
|
const name = declaration.propertyName || declaration.name;
|
|
66551
|
-
const parentType = getContextualTypeForVariableLikeDeclaration(parent, contextFlags) || parent.kind !== 207 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ?
|
|
66551
|
+
const parentType = getContextualTypeForVariableLikeDeclaration(parent, contextFlags) || parent.kind !== 207 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
|
|
66552
66552
|
if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name))
|
|
66553
66553
|
return void 0;
|
|
66554
66554
|
if (parent.name.kind === 206 /* ArrayBindingPattern */) {
|
|
@@ -67597,9 +67597,7 @@ function createTypeChecker(host) {
|
|
|
67597
67597
|
elementTypes.push(undefinedOrMissingType);
|
|
67598
67598
|
elementFlags.push(2 /* Optional */);
|
|
67599
67599
|
} else {
|
|
67600
|
-
const
|
|
67601
|
-
const elementCheckMode = (checkMode || 0 /* Normal */) | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
|
|
67602
|
-
const type = checkExpressionForMutableLocation(e, elementCheckMode, forceTuple);
|
|
67600
|
+
const type = checkExpressionForMutableLocation(e, checkMode, forceTuple);
|
|
67603
67601
|
elementTypes.push(addOptionality(
|
|
67604
67602
|
type,
|
|
67605
67603
|
/*isProperty*/
|
|
@@ -67607,7 +67605,7 @@ function createTypeChecker(host) {
|
|
|
67607
67605
|
hasOmittedExpression
|
|
67608
67606
|
));
|
|
67609
67607
|
elementFlags.push(hasOmittedExpression ? 2 /* Optional */ : 1 /* Required */);
|
|
67610
|
-
if (
|
|
67608
|
+
if (inTupleContext && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(e)) {
|
|
67611
67609
|
const inferenceContext = getInferenceContext(node);
|
|
67612
67610
|
Debug.assert(inferenceContext);
|
|
67613
67611
|
addIntraExpressionInferenceSite(inferenceContext, e, type);
|
|
@@ -67748,13 +67746,11 @@ function createTypeChecker(host) {
|
|
|
67748
67746
|
let member = getSymbolOfDeclaration(memberDecl);
|
|
67749
67747
|
const computedNameType = memberDecl.name && memberDecl.name.kind === 166 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
|
|
67750
67748
|
if (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 303 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
|
|
67751
|
-
|
|
67752
|
-
const propCheckMode = checkMode | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
|
|
67753
|
-
let type = memberDecl.kind === 302 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, propCheckMode) : (
|
|
67749
|
+
let type = memberDecl.kind === 302 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : (
|
|
67754
67750
|
// avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring
|
|
67755
67751
|
// for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`.
|
|
67756
67752
|
// we don't want to say "could not find 'a'".
|
|
67757
|
-
memberDecl.kind === 303 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name,
|
|
67753
|
+
memberDecl.kind === 303 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode)
|
|
67758
67754
|
);
|
|
67759
67755
|
if (isInJavascript) {
|
|
67760
67756
|
const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
|
|
@@ -67798,7 +67794,7 @@ function createTypeChecker(host) {
|
|
|
67798
67794
|
prop.links.target = member;
|
|
67799
67795
|
member = prop;
|
|
67800
67796
|
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
67801
|
-
if (
|
|
67797
|
+
if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 173 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
|
|
67802
67798
|
const inferenceContext = getInferenceContext(node);
|
|
67803
67799
|
Debug.assert(inferenceContext);
|
|
67804
67800
|
const inferenceNode = memberDecl.kind === 302 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
|
|
@@ -67971,9 +67967,7 @@ function createTypeChecker(host) {
|
|
|
67971
67967
|
for (const attributeDecl of attributes.properties) {
|
|
67972
67968
|
const member = attributeDecl.symbol;
|
|
67973
67969
|
if (isJsxAttribute(attributeDecl)) {
|
|
67974
|
-
const
|
|
67975
|
-
const attributeCheckMode = checkMode | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
|
|
67976
|
-
const exprType = checkJsxAttribute(attributeDecl, attributeCheckMode);
|
|
67970
|
+
const exprType = checkJsxAttribute(attributeDecl, checkMode);
|
|
67977
67971
|
objectFlags |= getObjectFlags(exprType) & 458752 /* PropagatingFlags */;
|
|
67978
67972
|
const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
|
|
67979
67973
|
attributeSymbol.declarations = member.declarations;
|
|
@@ -67994,7 +67988,7 @@ function createTypeChecker(host) {
|
|
|
67994
67988
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
67995
67989
|
}
|
|
67996
67990
|
}
|
|
67997
|
-
if (
|
|
67991
|
+
if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
|
|
67998
67992
|
const inferenceContext = getInferenceContext(attributes);
|
|
67999
67993
|
Debug.assert(inferenceContext);
|
|
68000
67994
|
const inferenceNode = attributeDecl.initializer.expression;
|
|
@@ -69612,7 +69606,7 @@ function createTypeChecker(host) {
|
|
|
69612
69606
|
}
|
|
69613
69607
|
for (let i = 0; i < argCount; i++) {
|
|
69614
69608
|
const arg = args[i];
|
|
69615
|
-
if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode &
|
|
69609
|
+
if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
|
|
69616
69610
|
const paramType = getTypeAtPosition(signature, i);
|
|
69617
69611
|
if (couldContainTypeVariables(paramType)) {
|
|
69618
69612
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -70225,12 +70219,12 @@ function createTypeChecker(host) {
|
|
|
70225
70219
|
const args = getEffectiveCallArguments(node);
|
|
70226
70220
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
70227
70221
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
70228
|
-
argCheckMode |= checkMode &
|
|
70222
|
+
argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
70229
70223
|
let candidatesForArgumentError;
|
|
70230
70224
|
let candidateForArgumentArityError;
|
|
70231
70225
|
let candidateForTypeArgumentError;
|
|
70232
70226
|
let result;
|
|
70233
|
-
const signatureHelpTrailingComma = !!(checkMode &
|
|
70227
|
+
const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 212 /* CallExpression */ && node.arguments.hasTrailingComma;
|
|
70234
70228
|
if (candidates.length > 1) {
|
|
70235
70229
|
result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
|
|
70236
70230
|
}
|
|
@@ -70449,7 +70443,7 @@ function createTypeChecker(host) {
|
|
|
70449
70443
|
continue;
|
|
70450
70444
|
}
|
|
70451
70445
|
if (argCheckMode) {
|
|
70452
|
-
argCheckMode = checkMode &
|
|
70446
|
+
argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
70453
70447
|
if (inferenceContext) {
|
|
70454
70448
|
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
70455
70449
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
@@ -73527,7 +73521,7 @@ function createTypeChecker(host) {
|
|
|
73527
73521
|
case 36 /* ExclamationEqualsToken */:
|
|
73528
73522
|
case 37 /* EqualsEqualsEqualsToken */:
|
|
73529
73523
|
case 38 /* ExclamationEqualsEqualsToken */:
|
|
73530
|
-
if (!(checkMode && checkMode &
|
|
73524
|
+
if (!(checkMode && checkMode & 128 /* TypeOnly */)) {
|
|
73531
73525
|
if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
|
|
73532
73526
|
const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
|
|
73533
73527
|
error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
|
|
@@ -74186,7 +74180,7 @@ function createTypeChecker(host) {
|
|
|
74186
74180
|
}
|
|
74187
74181
|
}
|
|
74188
74182
|
const startInvocationCount = flowInvocationCount;
|
|
74189
|
-
const type = checkExpression(node,
|
|
74183
|
+
const type = checkExpression(node, 128 /* TypeOnly */);
|
|
74190
74184
|
if (flowInvocationCount !== startInvocationCount) {
|
|
74191
74185
|
const cache = flowTypeCache || (flowTypeCache = []);
|
|
74192
74186
|
cache[getNodeId(node)] = type;
|
|
@@ -76657,7 +76651,7 @@ function createTypeChecker(host) {
|
|
|
76657
76651
|
checkComputedPropertyName(node.propertyName);
|
|
76658
76652
|
}
|
|
76659
76653
|
const parent = node.parent.parent;
|
|
76660
|
-
const parentCheckMode = node.dotDotDotToken ?
|
|
76654
|
+
const parentCheckMode = node.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */;
|
|
76661
76655
|
const parentType = getTypeForBindingElementParent(parent, parentCheckMode);
|
|
76662
76656
|
const name = node.propertyName || node.name;
|
|
76663
76657
|
if (parentType && !isBindingPattern(name)) {
|
|
@@ -95408,7 +95402,7 @@ function transformJsx(context) {
|
|
|
95408
95402
|
continue;
|
|
95409
95403
|
}
|
|
95410
95404
|
finishObjectLiteralIfNeeded();
|
|
95411
|
-
expressions.push(
|
|
95405
|
+
expressions.push(attr.expression);
|
|
95412
95406
|
continue;
|
|
95413
95407
|
}
|
|
95414
95408
|
properties.push(transformJsxAttributeToObjectLiteralElement(attr));
|