@typescript-deploys/pr-build 5.5.0-pr-57395-9 → 5.5.0-pr-57480-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +11 -184
- package/lib/tsserver.js +17 -190
- package/lib/typescript.js +17 -190
- package/lib/typingsInstaller.js +2 -4
- package/package.json +2 -2
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.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240223`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7810,9 +7810,7 @@ var Diagnostics = {
|
|
|
7810
7810
|
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
7811
7811
|
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'"),
|
|
7812
7812
|
Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."),
|
|
7813
|
-
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
|
|
7814
|
-
There_is_no_signature_in_type_0_such_that_its_parameters_are_assignable_to_the_parameters_of_signature_1: diag(18055, 1 /* Error */, "There_is_no_signature_in_type_0_such_that_its_parameters_are_assignable_to_the_parameters_of_signatu_18055", "There is no signature in type {0} such that its parameters are assignable to the parameters of signature {1}"),
|
|
7815
|
-
Parameters_of_signature_0_are_not_assignable_to_the_parameters_of_any_signature_in_type_1: diag(18056, 1 /* Error */, "Parameters_of_signature_0_are_not_assignable_to_the_parameters_of_any_signature_in_type_1_18056", "Parameters of signature {0} are not assignable to the parameters of any signature in type {1}")
|
|
7813
|
+
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
|
|
7816
7814
|
};
|
|
7817
7815
|
|
|
7818
7816
|
// src/compiler/scanner.ts
|
|
@@ -43671,8 +43669,6 @@ function createTypeChecker(host) {
|
|
|
43671
43669
|
var lastGetCombinedNodeFlagsResult = 0 /* None */;
|
|
43672
43670
|
var lastGetCombinedModifierFlagsNode;
|
|
43673
43671
|
var lastGetCombinedModifierFlagsResult = 0 /* None */;
|
|
43674
|
-
var checkTypeRelatedToDepth = 0;
|
|
43675
|
-
var checkTypeRelatedToCurrentlyVisitingMap;
|
|
43676
43672
|
const checker = {
|
|
43677
43673
|
getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0),
|
|
43678
43674
|
getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0),
|
|
@@ -45556,7 +45552,7 @@ function createTypeChecker(host) {
|
|
|
45556
45552
|
if (nameNotFoundMessage) {
|
|
45557
45553
|
addLazyDiagnostic(() => {
|
|
45558
45554
|
var _a2;
|
|
45559
|
-
if (
|
|
45555
|
+
if (errorLocation && (meaning & 2 /* BlockScopedVariable */ || (meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 111551 /* Value */) === 111551 /* Value */)) {
|
|
45560
45556
|
const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
|
|
45561
45557
|
if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */ || exportOrLocalSymbol.flags & 32 /* Class */ || exportOrLocalSymbol.flags & 384 /* Enum */) {
|
|
45562
45558
|
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
|
|
@@ -60605,7 +60601,7 @@ function createTypeChecker(host) {
|
|
|
60605
60601
|
}
|
|
60606
60602
|
return false;
|
|
60607
60603
|
}
|
|
60608
|
-
function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers
|
|
60604
|
+
function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) {
|
|
60609
60605
|
if (source === target) {
|
|
60610
60606
|
return -1 /* True */;
|
|
60611
60607
|
}
|
|
@@ -60670,21 +60666,12 @@ function createTypeChecker(host) {
|
|
|
60670
60666
|
const sourceSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(source, i) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
60671
60667
|
const targetSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(target, i) ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
|
|
60672
60668
|
const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && getTypeFacts(sourceType, 50331648 /* IsUndefinedOrNull */) === getTypeFacts(targetType, 50331648 /* IsUndefinedOrNull */);
|
|
60673
|
-
let related
|
|
60674
|
-
|
|
60675
|
-
|
|
60676
|
-
|
|
60677
|
-
|
|
60678
|
-
|
|
60679
|
-
sourceType,
|
|
60680
|
-
targetType,
|
|
60681
|
-
/*reportErrors*/
|
|
60682
|
-
false
|
|
60683
|
-
) || compareTypes(targetType, sourceType, reportErrors2);
|
|
60684
|
-
} else {
|
|
60685
|
-
related = compareTypes(sourceType, targetType, reportErrors2);
|
|
60686
|
-
}
|
|
60687
|
-
}
|
|
60669
|
+
let related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, checkMode & 8 /* StrictArity */ | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(
|
|
60670
|
+
sourceType,
|
|
60671
|
+
targetType,
|
|
60672
|
+
/*reportErrors*/
|
|
60673
|
+
false
|
|
60674
|
+
) || compareTypes(targetType, sourceType, reportErrors2);
|
|
60688
60675
|
if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(
|
|
60689
60676
|
sourceType,
|
|
60690
60677
|
targetType,
|
|
@@ -61003,33 +60990,6 @@ function createTypeChecker(host) {
|
|
|
61003
60990
|
let incompatibleStack;
|
|
61004
60991
|
let relationCount = 16e6 - relation.size >> 3;
|
|
61005
60992
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
61006
|
-
const visitingKey = getRelationKey(
|
|
61007
|
-
source,
|
|
61008
|
-
target,
|
|
61009
|
-
/*intersectionState*/
|
|
61010
|
-
0 /* None */,
|
|
61011
|
-
relation,
|
|
61012
|
-
/*ignoreConstraints*/
|
|
61013
|
-
false
|
|
61014
|
-
);
|
|
61015
|
-
if (checkTypeRelatedToDepth === 0) {
|
|
61016
|
-
checkTypeRelatedToCurrentlyVisitingMap = /* @__PURE__ */ new Map();
|
|
61017
|
-
}
|
|
61018
|
-
if (!errorNode && !headMessage) {
|
|
61019
|
-
let got = checkTypeRelatedToCurrentlyVisitingMap.get(visitingKey);
|
|
61020
|
-
const maxSameKey = 1;
|
|
61021
|
-
if (got && got >= maxSameKey) {
|
|
61022
|
-
relation.set(visitingKey, 1 /* Succeeded */);
|
|
61023
|
-
return true;
|
|
61024
|
-
} else {
|
|
61025
|
-
if (!got)
|
|
61026
|
-
got = 1;
|
|
61027
|
-
else
|
|
61028
|
-
got = got + 1;
|
|
61029
|
-
checkTypeRelatedToCurrentlyVisitingMap.set(visitingKey, got);
|
|
61030
|
-
}
|
|
61031
|
-
}
|
|
61032
|
-
checkTypeRelatedToDepth++;
|
|
61033
60993
|
const result = isRelatedTo(
|
|
61034
60994
|
source,
|
|
61035
60995
|
target,
|
|
@@ -61097,18 +61057,6 @@ function createTypeChecker(host) {
|
|
|
61097
61057
|
if (errorNode && errorOutputContainer && errorOutputContainer.skipLogging && result === 0 /* False */) {
|
|
61098
61058
|
Debug.assert(!!errorOutputContainer.errors, "missed opportunity to interact with error.");
|
|
61099
61059
|
}
|
|
61100
|
-
checkTypeRelatedToDepth--;
|
|
61101
|
-
if (checkTypeRelatedToDepth === 0) {
|
|
61102
|
-
checkTypeRelatedToCurrentlyVisitingMap = void 0;
|
|
61103
|
-
} else {
|
|
61104
|
-
const got = checkTypeRelatedToCurrentlyVisitingMap.get(visitingKey);
|
|
61105
|
-
if (got) {
|
|
61106
|
-
if (got === 1)
|
|
61107
|
-
checkTypeRelatedToCurrentlyVisitingMap.delete(visitingKey);
|
|
61108
|
-
else
|
|
61109
|
-
checkTypeRelatedToCurrentlyVisitingMap.set(visitingKey, got - 1);
|
|
61110
|
-
}
|
|
61111
|
-
}
|
|
61112
61060
|
return result !== 0 /* False */;
|
|
61113
61061
|
function resetErrorInfo(saved) {
|
|
61114
61062
|
errorInfo = saved.errorInfo;
|
|
@@ -61595,112 +61543,6 @@ function createTypeChecker(host) {
|
|
|
61595
61543
|
function shouldCheckAsExcessProperty(prop, container) {
|
|
61596
61544
|
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
|
|
61597
61545
|
}
|
|
61598
|
-
function checkOverloadsRelatedToIntersection(source2, target2, _reportErrors) {
|
|
61599
|
-
const sourceSignatures = getSignaturesOfType(source2, 0 /* Call */);
|
|
61600
|
-
const constructSignatureToString = (signature, forceReturnType) => {
|
|
61601
|
-
const origReturnType = signature.resolvedReturnType;
|
|
61602
|
-
signature.resolvedReturnType = forceReturnType;
|
|
61603
|
-
const str = signatureToString(
|
|
61604
|
-
signature,
|
|
61605
|
-
/*enclosingDeclaration*/
|
|
61606
|
-
void 0,
|
|
61607
|
-
262144 /* WriteArrowStyleSignature */,
|
|
61608
|
-
0 /* Call */
|
|
61609
|
-
);
|
|
61610
|
-
signature.resolvedReturnType = origReturnType;
|
|
61611
|
-
return str;
|
|
61612
|
-
};
|
|
61613
|
-
const mapAssignedToBy = /* @__PURE__ */ new Map();
|
|
61614
|
-
const failed = sourceSignatures.some((ssig, _si) => {
|
|
61615
|
-
if (getReturnTypeOfSignature(ssig) === neverType)
|
|
61616
|
-
return false;
|
|
61617
|
-
const accum = {
|
|
61618
|
-
hadMatch: false,
|
|
61619
|
-
gReturn: neverType,
|
|
61620
|
-
gReturnAllVoid: true
|
|
61621
|
-
};
|
|
61622
|
-
const matchedTargetSigs = [];
|
|
61623
|
-
target2.types.forEach((targetMember, _tti) => {
|
|
61624
|
-
const targetSignatures = getSignaturesOfType(targetMember, 0 /* Call */);
|
|
61625
|
-
targetSignatures.forEach((tsig, _ti) => {
|
|
61626
|
-
const targetReturnType = getReturnTypeOfSignature(tsig);
|
|
61627
|
-
if (compareSignaturesRelated(
|
|
61628
|
-
ssig,
|
|
61629
|
-
tsig,
|
|
61630
|
-
0 /* None */ | 4 /* IgnoreReturnTypes */,
|
|
61631
|
-
/*reportErrors*/
|
|
61632
|
-
false,
|
|
61633
|
-
/*errorReporter*/
|
|
61634
|
-
void 0,
|
|
61635
|
-
/*incompatibleErrorReporter*/
|
|
61636
|
-
void 0,
|
|
61637
|
-
compareTypesIdentical,
|
|
61638
|
-
// compareTypesAssignable,
|
|
61639
|
-
/*reportUnreliableMarkers*/
|
|
61640
|
-
void 0,
|
|
61641
|
-
/*compareTypesUnilaterally*/
|
|
61642
|
-
true
|
|
61643
|
-
) === -1 /* True */) {
|
|
61644
|
-
accum.hadMatch = true;
|
|
61645
|
-
if (targetReturnType !== voidType) {
|
|
61646
|
-
accum.gReturn = getUnionType([accum.gReturn, targetReturnType]);
|
|
61647
|
-
accum.gReturnAllVoid = false;
|
|
61648
|
-
}
|
|
61649
|
-
matchedTargetSigs.push(tsig);
|
|
61650
|
-
let mtti = mapAssignedToBy.get(_tti);
|
|
61651
|
-
if (!mtti) {
|
|
61652
|
-
mtti = /* @__PURE__ */ new Map();
|
|
61653
|
-
mapAssignedToBy.set(_tti, mtti);
|
|
61654
|
-
}
|
|
61655
|
-
const setsi = mtti.get(_ti);
|
|
61656
|
-
if (!setsi) {
|
|
61657
|
-
mtti.set(_ti, true);
|
|
61658
|
-
}
|
|
61659
|
-
}
|
|
61660
|
-
});
|
|
61661
|
-
});
|
|
61662
|
-
if (!accum.hadMatch) {
|
|
61663
|
-
if (_reportErrors) {
|
|
61664
|
-
resetErrorInfo({ skipParentCounter: 0 });
|
|
61665
|
-
reportError(Diagnostics.Parameters_of_signature_0_are_not_assignable_to_the_parameters_of_any_signature_in_type_1, constructSignatureToString(ssig), typeToString(target2));
|
|
61666
|
-
}
|
|
61667
|
-
return true;
|
|
61668
|
-
} else {
|
|
61669
|
-
const returnType = getReturnTypeOfSignature(ssig);
|
|
61670
|
-
if (!accum.gReturnAllVoid && !isTypeAssignableTo(returnType, accum.gReturn)) {
|
|
61671
|
-
if (_reportErrors) {
|
|
61672
|
-
resetErrorInfo({ skipParentCounter: 0 });
|
|
61673
|
-
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, typeToString(returnType), typeToString(accum.gReturn));
|
|
61674
|
-
const strset = /* @__PURE__ */ new Set();
|
|
61675
|
-
matchedTargetSigs.forEach((tsig) => strset.add(constructSignatureToString(tsig)));
|
|
61676
|
-
const strarr = [];
|
|
61677
|
-
strset.forEach((tstr) => strarr.push(tstr));
|
|
61678
|
-
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(ssig), strarr.join(" | "));
|
|
61679
|
-
}
|
|
61680
|
-
return true;
|
|
61681
|
-
}
|
|
61682
|
-
}
|
|
61683
|
-
});
|
|
61684
|
-
if (failed)
|
|
61685
|
-
return { computed: true, ternary: 0 /* False */ };
|
|
61686
|
-
const failed2 = target2.types.some((targetMember, _tti) => {
|
|
61687
|
-
const mtti = mapAssignedToBy.get(_tti);
|
|
61688
|
-
const targetSignatures = getSignaturesOfType(targetMember, 0 /* Call */);
|
|
61689
|
-
return targetSignatures.some((tsig, _ti) => {
|
|
61690
|
-
if (!mtti || !mtti.get(_ti)) {
|
|
61691
|
-
if (_reportErrors) {
|
|
61692
|
-
resetErrorInfo({ skipParentCounter: 0 });
|
|
61693
|
-
reportError(Diagnostics.There_is_no_signature_in_type_0_such_that_its_parameters_are_assignable_to_the_parameters_of_signature_1, typeToString(source2), constructSignatureToString(tsig, anyType));
|
|
61694
|
-
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, typeToString(source2), typeToString(targetMember));
|
|
61695
|
-
}
|
|
61696
|
-
return true;
|
|
61697
|
-
}
|
|
61698
|
-
});
|
|
61699
|
-
});
|
|
61700
|
-
if (failed2)
|
|
61701
|
-
return { computed: true, ternary: 0 /* False */ };
|
|
61702
|
-
return { computed: true, ternary: -1 /* True */ };
|
|
61703
|
-
}
|
|
61704
61546
|
function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
61705
61547
|
if (source2.flags & 1048576 /* Union */) {
|
|
61706
61548
|
if (target2.flags & 1048576 /* Union */) {
|
|
@@ -61719,22 +61561,7 @@ function createTypeChecker(host) {
|
|
|
61719
61561
|
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */) && !(target2.flags & 402784252 /* Primitive */), intersectionState);
|
|
61720
61562
|
}
|
|
61721
61563
|
if (target2.flags & 2097152 /* Intersection */) {
|
|
61722
|
-
|
|
61723
|
-
if (result1 === 0 /* False */) {
|
|
61724
|
-
const sourceSignatures = getSignaturesOfType(source2, 0 /* Call */);
|
|
61725
|
-
if (sourceSignatures.every((sourceSig) => {
|
|
61726
|
-
return !sourceSig.typeParameters;
|
|
61727
|
-
})) {
|
|
61728
|
-
if (source2.flags & 524288 /* Object */ && getSignaturesOfType(source2, 0 /* Call */).length > 1) {
|
|
61729
|
-
const { computed, ternary } = checkOverloadsRelatedToIntersection(source2, target2, reportErrors2);
|
|
61730
|
-
if (computed) {
|
|
61731
|
-
Debug.assert(ternary === -1 /* True */ || ternary === 0 /* False */);
|
|
61732
|
-
return ternary;
|
|
61733
|
-
}
|
|
61734
|
-
}
|
|
61735
|
-
}
|
|
61736
|
-
}
|
|
61737
|
-
return result1;
|
|
61564
|
+
return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */);
|
|
61738
61565
|
}
|
|
61739
61566
|
if (relation === comparableRelation && target2.flags & 402784252 /* Primitive */) {
|
|
61740
61567
|
const constraints = sameMap(source2.types, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(t) || unknownType : t);
|
package/lib/tsserver.js
CHANGED
|
@@ -2341,7 +2341,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2341
2341
|
|
|
2342
2342
|
// src/compiler/corePublic.ts
|
|
2343
2343
|
var versionMajorMinor = "5.5";
|
|
2344
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2344
|
+
var version = `${versionMajorMinor}.0-insiders.20240223`;
|
|
2345
2345
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2346
2346
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2347
2347
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -11378,9 +11378,7 @@ var Diagnostics = {
|
|
|
11378
11378
|
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
11379
11379
|
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'"),
|
|
11380
11380
|
Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."),
|
|
11381
|
-
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
|
|
11382
|
-
There_is_no_signature_in_type_0_such_that_its_parameters_are_assignable_to_the_parameters_of_signature_1: diag(18055, 1 /* Error */, "There_is_no_signature_in_type_0_such_that_its_parameters_are_assignable_to_the_parameters_of_signatu_18055", "There is no signature in type {0} such that its parameters are assignable to the parameters of signature {1}"),
|
|
11383
|
-
Parameters_of_signature_0_are_not_assignable_to_the_parameters_of_any_signature_in_type_1: diag(18056, 1 /* Error */, "Parameters_of_signature_0_are_not_assignable_to_the_parameters_of_any_signature_in_type_1_18056", "Parameters of signature {0} are not assignable to the parameters of any signature in type {1}")
|
|
11381
|
+
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
|
|
11384
11382
|
};
|
|
11385
11383
|
|
|
11386
11384
|
// src/compiler/scanner.ts
|
|
@@ -48416,8 +48414,6 @@ function createTypeChecker(host) {
|
|
|
48416
48414
|
var lastGetCombinedNodeFlagsResult = 0 /* None */;
|
|
48417
48415
|
var lastGetCombinedModifierFlagsNode;
|
|
48418
48416
|
var lastGetCombinedModifierFlagsResult = 0 /* None */;
|
|
48419
|
-
var checkTypeRelatedToDepth = 0;
|
|
48420
|
-
var checkTypeRelatedToCurrentlyVisitingMap;
|
|
48421
48417
|
const checker = {
|
|
48422
48418
|
getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0),
|
|
48423
48419
|
getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0),
|
|
@@ -50301,7 +50297,7 @@ function createTypeChecker(host) {
|
|
|
50301
50297
|
if (nameNotFoundMessage) {
|
|
50302
50298
|
addLazyDiagnostic(() => {
|
|
50303
50299
|
var _a2;
|
|
50304
|
-
if (
|
|
50300
|
+
if (errorLocation && (meaning & 2 /* BlockScopedVariable */ || (meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 111551 /* Value */) === 111551 /* Value */)) {
|
|
50305
50301
|
const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
|
|
50306
50302
|
if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */ || exportOrLocalSymbol.flags & 32 /* Class */ || exportOrLocalSymbol.flags & 384 /* Enum */) {
|
|
50307
50303
|
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
|
|
@@ -65350,7 +65346,7 @@ function createTypeChecker(host) {
|
|
|
65350
65346
|
}
|
|
65351
65347
|
return false;
|
|
65352
65348
|
}
|
|
65353
|
-
function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers
|
|
65349
|
+
function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) {
|
|
65354
65350
|
if (source === target) {
|
|
65355
65351
|
return -1 /* True */;
|
|
65356
65352
|
}
|
|
@@ -65415,21 +65411,12 @@ function createTypeChecker(host) {
|
|
|
65415
65411
|
const sourceSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(source, i) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
65416
65412
|
const targetSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(target, i) ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
|
|
65417
65413
|
const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && getTypeFacts(sourceType, 50331648 /* IsUndefinedOrNull */) === getTypeFacts(targetType, 50331648 /* IsUndefinedOrNull */);
|
|
65418
|
-
let related
|
|
65419
|
-
|
|
65420
|
-
|
|
65421
|
-
|
|
65422
|
-
|
|
65423
|
-
|
|
65424
|
-
sourceType,
|
|
65425
|
-
targetType,
|
|
65426
|
-
/*reportErrors*/
|
|
65427
|
-
false
|
|
65428
|
-
) || compareTypes(targetType, sourceType, reportErrors2);
|
|
65429
|
-
} else {
|
|
65430
|
-
related = compareTypes(sourceType, targetType, reportErrors2);
|
|
65431
|
-
}
|
|
65432
|
-
}
|
|
65414
|
+
let related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, checkMode & 8 /* StrictArity */ | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(
|
|
65415
|
+
sourceType,
|
|
65416
|
+
targetType,
|
|
65417
|
+
/*reportErrors*/
|
|
65418
|
+
false
|
|
65419
|
+
) || compareTypes(targetType, sourceType, reportErrors2);
|
|
65433
65420
|
if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(
|
|
65434
65421
|
sourceType,
|
|
65435
65422
|
targetType,
|
|
@@ -65748,33 +65735,6 @@ function createTypeChecker(host) {
|
|
|
65748
65735
|
let incompatibleStack;
|
|
65749
65736
|
let relationCount = 16e6 - relation.size >> 3;
|
|
65750
65737
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
65751
|
-
const visitingKey = getRelationKey(
|
|
65752
|
-
source,
|
|
65753
|
-
target,
|
|
65754
|
-
/*intersectionState*/
|
|
65755
|
-
0 /* None */,
|
|
65756
|
-
relation,
|
|
65757
|
-
/*ignoreConstraints*/
|
|
65758
|
-
false
|
|
65759
|
-
);
|
|
65760
|
-
if (checkTypeRelatedToDepth === 0) {
|
|
65761
|
-
checkTypeRelatedToCurrentlyVisitingMap = /* @__PURE__ */ new Map();
|
|
65762
|
-
}
|
|
65763
|
-
if (!errorNode && !headMessage) {
|
|
65764
|
-
let got = checkTypeRelatedToCurrentlyVisitingMap.get(visitingKey);
|
|
65765
|
-
const maxSameKey = 1;
|
|
65766
|
-
if (got && got >= maxSameKey) {
|
|
65767
|
-
relation.set(visitingKey, 1 /* Succeeded */);
|
|
65768
|
-
return true;
|
|
65769
|
-
} else {
|
|
65770
|
-
if (!got)
|
|
65771
|
-
got = 1;
|
|
65772
|
-
else
|
|
65773
|
-
got = got + 1;
|
|
65774
|
-
checkTypeRelatedToCurrentlyVisitingMap.set(visitingKey, got);
|
|
65775
|
-
}
|
|
65776
|
-
}
|
|
65777
|
-
checkTypeRelatedToDepth++;
|
|
65778
65738
|
const result = isRelatedTo(
|
|
65779
65739
|
source,
|
|
65780
65740
|
target,
|
|
@@ -65842,18 +65802,6 @@ function createTypeChecker(host) {
|
|
|
65842
65802
|
if (errorNode && errorOutputContainer && errorOutputContainer.skipLogging && result === 0 /* False */) {
|
|
65843
65803
|
Debug.assert(!!errorOutputContainer.errors, "missed opportunity to interact with error.");
|
|
65844
65804
|
}
|
|
65845
|
-
checkTypeRelatedToDepth--;
|
|
65846
|
-
if (checkTypeRelatedToDepth === 0) {
|
|
65847
|
-
checkTypeRelatedToCurrentlyVisitingMap = void 0;
|
|
65848
|
-
} else {
|
|
65849
|
-
const got = checkTypeRelatedToCurrentlyVisitingMap.get(visitingKey);
|
|
65850
|
-
if (got) {
|
|
65851
|
-
if (got === 1)
|
|
65852
|
-
checkTypeRelatedToCurrentlyVisitingMap.delete(visitingKey);
|
|
65853
|
-
else
|
|
65854
|
-
checkTypeRelatedToCurrentlyVisitingMap.set(visitingKey, got - 1);
|
|
65855
|
-
}
|
|
65856
|
-
}
|
|
65857
65805
|
return result !== 0 /* False */;
|
|
65858
65806
|
function resetErrorInfo(saved) {
|
|
65859
65807
|
errorInfo = saved.errorInfo;
|
|
@@ -66340,112 +66288,6 @@ function createTypeChecker(host) {
|
|
|
66340
66288
|
function shouldCheckAsExcessProperty(prop, container) {
|
|
66341
66289
|
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
|
|
66342
66290
|
}
|
|
66343
|
-
function checkOverloadsRelatedToIntersection(source2, target2, _reportErrors) {
|
|
66344
|
-
const sourceSignatures = getSignaturesOfType(source2, 0 /* Call */);
|
|
66345
|
-
const constructSignatureToString = (signature, forceReturnType) => {
|
|
66346
|
-
const origReturnType = signature.resolvedReturnType;
|
|
66347
|
-
signature.resolvedReturnType = forceReturnType;
|
|
66348
|
-
const str = signatureToString(
|
|
66349
|
-
signature,
|
|
66350
|
-
/*enclosingDeclaration*/
|
|
66351
|
-
void 0,
|
|
66352
|
-
262144 /* WriteArrowStyleSignature */,
|
|
66353
|
-
0 /* Call */
|
|
66354
|
-
);
|
|
66355
|
-
signature.resolvedReturnType = origReturnType;
|
|
66356
|
-
return str;
|
|
66357
|
-
};
|
|
66358
|
-
const mapAssignedToBy = /* @__PURE__ */ new Map();
|
|
66359
|
-
const failed = sourceSignatures.some((ssig, _si) => {
|
|
66360
|
-
if (getReturnTypeOfSignature(ssig) === neverType)
|
|
66361
|
-
return false;
|
|
66362
|
-
const accum = {
|
|
66363
|
-
hadMatch: false,
|
|
66364
|
-
gReturn: neverType,
|
|
66365
|
-
gReturnAllVoid: true
|
|
66366
|
-
};
|
|
66367
|
-
const matchedTargetSigs = [];
|
|
66368
|
-
target2.types.forEach((targetMember, _tti) => {
|
|
66369
|
-
const targetSignatures = getSignaturesOfType(targetMember, 0 /* Call */);
|
|
66370
|
-
targetSignatures.forEach((tsig, _ti) => {
|
|
66371
|
-
const targetReturnType = getReturnTypeOfSignature(tsig);
|
|
66372
|
-
if (compareSignaturesRelated(
|
|
66373
|
-
ssig,
|
|
66374
|
-
tsig,
|
|
66375
|
-
0 /* None */ | 4 /* IgnoreReturnTypes */,
|
|
66376
|
-
/*reportErrors*/
|
|
66377
|
-
false,
|
|
66378
|
-
/*errorReporter*/
|
|
66379
|
-
void 0,
|
|
66380
|
-
/*incompatibleErrorReporter*/
|
|
66381
|
-
void 0,
|
|
66382
|
-
compareTypesIdentical,
|
|
66383
|
-
// compareTypesAssignable,
|
|
66384
|
-
/*reportUnreliableMarkers*/
|
|
66385
|
-
void 0,
|
|
66386
|
-
/*compareTypesUnilaterally*/
|
|
66387
|
-
true
|
|
66388
|
-
) === -1 /* True */) {
|
|
66389
|
-
accum.hadMatch = true;
|
|
66390
|
-
if (targetReturnType !== voidType) {
|
|
66391
|
-
accum.gReturn = getUnionType([accum.gReturn, targetReturnType]);
|
|
66392
|
-
accum.gReturnAllVoid = false;
|
|
66393
|
-
}
|
|
66394
|
-
matchedTargetSigs.push(tsig);
|
|
66395
|
-
let mtti = mapAssignedToBy.get(_tti);
|
|
66396
|
-
if (!mtti) {
|
|
66397
|
-
mtti = /* @__PURE__ */ new Map();
|
|
66398
|
-
mapAssignedToBy.set(_tti, mtti);
|
|
66399
|
-
}
|
|
66400
|
-
const setsi = mtti.get(_ti);
|
|
66401
|
-
if (!setsi) {
|
|
66402
|
-
mtti.set(_ti, true);
|
|
66403
|
-
}
|
|
66404
|
-
}
|
|
66405
|
-
});
|
|
66406
|
-
});
|
|
66407
|
-
if (!accum.hadMatch) {
|
|
66408
|
-
if (_reportErrors) {
|
|
66409
|
-
resetErrorInfo({ skipParentCounter: 0 });
|
|
66410
|
-
reportError(Diagnostics.Parameters_of_signature_0_are_not_assignable_to_the_parameters_of_any_signature_in_type_1, constructSignatureToString(ssig), typeToString(target2));
|
|
66411
|
-
}
|
|
66412
|
-
return true;
|
|
66413
|
-
} else {
|
|
66414
|
-
const returnType = getReturnTypeOfSignature(ssig);
|
|
66415
|
-
if (!accum.gReturnAllVoid && !isTypeAssignableTo(returnType, accum.gReturn)) {
|
|
66416
|
-
if (_reportErrors) {
|
|
66417
|
-
resetErrorInfo({ skipParentCounter: 0 });
|
|
66418
|
-
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, typeToString(returnType), typeToString(accum.gReturn));
|
|
66419
|
-
const strset = /* @__PURE__ */ new Set();
|
|
66420
|
-
matchedTargetSigs.forEach((tsig) => strset.add(constructSignatureToString(tsig)));
|
|
66421
|
-
const strarr = [];
|
|
66422
|
-
strset.forEach((tstr) => strarr.push(tstr));
|
|
66423
|
-
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(ssig), strarr.join(" | "));
|
|
66424
|
-
}
|
|
66425
|
-
return true;
|
|
66426
|
-
}
|
|
66427
|
-
}
|
|
66428
|
-
});
|
|
66429
|
-
if (failed)
|
|
66430
|
-
return { computed: true, ternary: 0 /* False */ };
|
|
66431
|
-
const failed2 = target2.types.some((targetMember, _tti) => {
|
|
66432
|
-
const mtti = mapAssignedToBy.get(_tti);
|
|
66433
|
-
const targetSignatures = getSignaturesOfType(targetMember, 0 /* Call */);
|
|
66434
|
-
return targetSignatures.some((tsig, _ti) => {
|
|
66435
|
-
if (!mtti || !mtti.get(_ti)) {
|
|
66436
|
-
if (_reportErrors) {
|
|
66437
|
-
resetErrorInfo({ skipParentCounter: 0 });
|
|
66438
|
-
reportError(Diagnostics.There_is_no_signature_in_type_0_such_that_its_parameters_are_assignable_to_the_parameters_of_signature_1, typeToString(source2), constructSignatureToString(tsig, anyType));
|
|
66439
|
-
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, typeToString(source2), typeToString(targetMember));
|
|
66440
|
-
}
|
|
66441
|
-
return true;
|
|
66442
|
-
}
|
|
66443
|
-
});
|
|
66444
|
-
});
|
|
66445
|
-
if (failed2)
|
|
66446
|
-
return { computed: true, ternary: 0 /* False */ };
|
|
66447
|
-
return { computed: true, ternary: -1 /* True */ };
|
|
66448
|
-
}
|
|
66449
66291
|
function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
66450
66292
|
if (source2.flags & 1048576 /* Union */) {
|
|
66451
66293
|
if (target2.flags & 1048576 /* Union */) {
|
|
@@ -66464,22 +66306,7 @@ function createTypeChecker(host) {
|
|
|
66464
66306
|
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */) && !(target2.flags & 402784252 /* Primitive */), intersectionState);
|
|
66465
66307
|
}
|
|
66466
66308
|
if (target2.flags & 2097152 /* Intersection */) {
|
|
66467
|
-
|
|
66468
|
-
if (result1 === 0 /* False */) {
|
|
66469
|
-
const sourceSignatures = getSignaturesOfType(source2, 0 /* Call */);
|
|
66470
|
-
if (sourceSignatures.every((sourceSig) => {
|
|
66471
|
-
return !sourceSig.typeParameters;
|
|
66472
|
-
})) {
|
|
66473
|
-
if (source2.flags & 524288 /* Object */ && getSignaturesOfType(source2, 0 /* Call */).length > 1) {
|
|
66474
|
-
const { computed, ternary } = checkOverloadsRelatedToIntersection(source2, target2, reportErrors2);
|
|
66475
|
-
if (computed) {
|
|
66476
|
-
Debug.assert(ternary === -1 /* True */ || ternary === 0 /* False */);
|
|
66477
|
-
return ternary;
|
|
66478
|
-
}
|
|
66479
|
-
}
|
|
66480
|
-
}
|
|
66481
|
-
}
|
|
66482
|
-
return result1;
|
|
66309
|
+
return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */);
|
|
66483
66310
|
}
|
|
66484
66311
|
if (relation === comparableRelation && target2.flags & 402784252 /* Primitive */) {
|
|
66485
66312
|
const constraints = sameMap(source2.types, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(t) || unknownType : t);
|
|
@@ -159954,7 +159781,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
159954
159781
|
let importAdder;
|
|
159955
159782
|
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
159956
159783
|
if (memberCompletionEntry) {
|
|
159957
|
-
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
159784
|
+
({ insertText, filterText, isSnippet, importAdder, replacementSpan } = memberCompletionEntry);
|
|
159958
159785
|
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
159959
159786
|
hasAction = true;
|
|
159960
159787
|
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
@@ -160142,7 +159969,7 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
160142
159969
|
);
|
|
160143
159970
|
}
|
|
160144
159971
|
}
|
|
160145
|
-
return { insertText, filterText, isSnippet, importAdder, eraseRange };
|
|
159972
|
+
return { insertText, filterText, isSnippet, importAdder, replacementSpan: eraseRange && createTextSpanFromBounds(eraseRange.pos, eraseRange.end) };
|
|
160146
159973
|
}
|
|
160147
159974
|
function getPresentModifiers(contextToken, sourceFile, position) {
|
|
160148
159975
|
if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
|
|
@@ -160794,7 +160621,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
160794
160621
|
}
|
|
160795
160622
|
}
|
|
160796
160623
|
if (source === "ClassMemberSnippet/" /* ClassMemberSnippet */) {
|
|
160797
|
-
const { importAdder,
|
|
160624
|
+
const { importAdder, replacementSpan } = getEntryForMemberCompletion(
|
|
160798
160625
|
host,
|
|
160799
160626
|
program,
|
|
160800
160627
|
compilerOptions,
|
|
@@ -160806,15 +160633,15 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
160806
160633
|
contextToken,
|
|
160807
160634
|
formatContext
|
|
160808
160635
|
);
|
|
160809
|
-
if (importAdder ||
|
|
160636
|
+
if (importAdder || replacementSpan) {
|
|
160810
160637
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
160811
160638
|
{ host, formatContext, preferences },
|
|
160812
160639
|
(tracker) => {
|
|
160813
160640
|
if (importAdder) {
|
|
160814
160641
|
importAdder.writeFixes(tracker);
|
|
160815
160642
|
}
|
|
160816
|
-
if (
|
|
160817
|
-
tracker.deleteRange(sourceFile,
|
|
160643
|
+
if (replacementSpan) {
|
|
160644
|
+
tracker.deleteRange(sourceFile, { pos: replacementSpan.start, end: replacementSpan.start + replacementSpan.length });
|
|
160818
160645
|
}
|
|
160819
160646
|
}
|
|
160820
160647
|
);
|
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.5";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20240223`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -9147,9 +9147,7 @@ ${lanes.join("\n")}
|
|
|
9147
9147
|
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
9148
9148
|
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'"),
|
|
9149
9149
|
Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."),
|
|
9150
|
-
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
|
|
9151
|
-
There_is_no_signature_in_type_0_such_that_its_parameters_are_assignable_to_the_parameters_of_signature_1: diag(18055, 1 /* Error */, "There_is_no_signature_in_type_0_such_that_its_parameters_are_assignable_to_the_parameters_of_signatu_18055", "There is no signature in type {0} such that its parameters are assignable to the parameters of signature {1}"),
|
|
9152
|
-
Parameters_of_signature_0_are_not_assignable_to_the_parameters_of_any_signature_in_type_1: diag(18056, 1 /* Error */, "Parameters_of_signature_0_are_not_assignable_to_the_parameters_of_any_signature_in_type_1_18056", "Parameters of signature {0} are not assignable to the parameters of any signature in type {1}")
|
|
9150
|
+
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
|
|
9153
9151
|
};
|
|
9154
9152
|
}
|
|
9155
9153
|
});
|
|
@@ -46170,8 +46168,6 @@ ${lanes.join("\n")}
|
|
|
46170
46168
|
var lastGetCombinedNodeFlagsResult = 0 /* None */;
|
|
46171
46169
|
var lastGetCombinedModifierFlagsNode;
|
|
46172
46170
|
var lastGetCombinedModifierFlagsResult = 0 /* None */;
|
|
46173
|
-
var checkTypeRelatedToDepth = 0;
|
|
46174
|
-
var checkTypeRelatedToCurrentlyVisitingMap;
|
|
46175
46171
|
const checker = {
|
|
46176
46172
|
getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0),
|
|
46177
46173
|
getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0),
|
|
@@ -48055,7 +48051,7 @@ ${lanes.join("\n")}
|
|
|
48055
48051
|
if (nameNotFoundMessage) {
|
|
48056
48052
|
addLazyDiagnostic(() => {
|
|
48057
48053
|
var _a2;
|
|
48058
|
-
if (
|
|
48054
|
+
if (errorLocation && (meaning & 2 /* BlockScopedVariable */ || (meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 111551 /* Value */) === 111551 /* Value */)) {
|
|
48059
48055
|
const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
|
|
48060
48056
|
if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */ || exportOrLocalSymbol.flags & 32 /* Class */ || exportOrLocalSymbol.flags & 384 /* Enum */) {
|
|
48061
48057
|
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
|
|
@@ -63104,7 +63100,7 @@ ${lanes.join("\n")}
|
|
|
63104
63100
|
}
|
|
63105
63101
|
return false;
|
|
63106
63102
|
}
|
|
63107
|
-
function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers
|
|
63103
|
+
function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) {
|
|
63108
63104
|
if (source === target) {
|
|
63109
63105
|
return -1 /* True */;
|
|
63110
63106
|
}
|
|
@@ -63169,21 +63165,12 @@ ${lanes.join("\n")}
|
|
|
63169
63165
|
const sourceSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(source, i) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
63170
63166
|
const targetSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(target, i) ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
|
|
63171
63167
|
const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && getTypeFacts(sourceType, 50331648 /* IsUndefinedOrNull */) === getTypeFacts(targetType, 50331648 /* IsUndefinedOrNull */);
|
|
63172
|
-
let related
|
|
63173
|
-
|
|
63174
|
-
|
|
63175
|
-
|
|
63176
|
-
|
|
63177
|
-
|
|
63178
|
-
sourceType,
|
|
63179
|
-
targetType,
|
|
63180
|
-
/*reportErrors*/
|
|
63181
|
-
false
|
|
63182
|
-
) || compareTypes(targetType, sourceType, reportErrors2);
|
|
63183
|
-
} else {
|
|
63184
|
-
related = compareTypes(sourceType, targetType, reportErrors2);
|
|
63185
|
-
}
|
|
63186
|
-
}
|
|
63168
|
+
let related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, checkMode & 8 /* StrictArity */ | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(
|
|
63169
|
+
sourceType,
|
|
63170
|
+
targetType,
|
|
63171
|
+
/*reportErrors*/
|
|
63172
|
+
false
|
|
63173
|
+
) || compareTypes(targetType, sourceType, reportErrors2);
|
|
63187
63174
|
if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(
|
|
63188
63175
|
sourceType,
|
|
63189
63176
|
targetType,
|
|
@@ -63502,33 +63489,6 @@ ${lanes.join("\n")}
|
|
|
63502
63489
|
let incompatibleStack;
|
|
63503
63490
|
let relationCount = 16e6 - relation.size >> 3;
|
|
63504
63491
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
63505
|
-
const visitingKey = getRelationKey(
|
|
63506
|
-
source,
|
|
63507
|
-
target,
|
|
63508
|
-
/*intersectionState*/
|
|
63509
|
-
0 /* None */,
|
|
63510
|
-
relation,
|
|
63511
|
-
/*ignoreConstraints*/
|
|
63512
|
-
false
|
|
63513
|
-
);
|
|
63514
|
-
if (checkTypeRelatedToDepth === 0) {
|
|
63515
|
-
checkTypeRelatedToCurrentlyVisitingMap = /* @__PURE__ */ new Map();
|
|
63516
|
-
}
|
|
63517
|
-
if (!errorNode && !headMessage) {
|
|
63518
|
-
let got = checkTypeRelatedToCurrentlyVisitingMap.get(visitingKey);
|
|
63519
|
-
const maxSameKey = 1;
|
|
63520
|
-
if (got && got >= maxSameKey) {
|
|
63521
|
-
relation.set(visitingKey, 1 /* Succeeded */);
|
|
63522
|
-
return true;
|
|
63523
|
-
} else {
|
|
63524
|
-
if (!got)
|
|
63525
|
-
got = 1;
|
|
63526
|
-
else
|
|
63527
|
-
got = got + 1;
|
|
63528
|
-
checkTypeRelatedToCurrentlyVisitingMap.set(visitingKey, got);
|
|
63529
|
-
}
|
|
63530
|
-
}
|
|
63531
|
-
checkTypeRelatedToDepth++;
|
|
63532
63492
|
const result = isRelatedTo(
|
|
63533
63493
|
source,
|
|
63534
63494
|
target,
|
|
@@ -63596,18 +63556,6 @@ ${lanes.join("\n")}
|
|
|
63596
63556
|
if (errorNode && errorOutputContainer && errorOutputContainer.skipLogging && result === 0 /* False */) {
|
|
63597
63557
|
Debug.assert(!!errorOutputContainer.errors, "missed opportunity to interact with error.");
|
|
63598
63558
|
}
|
|
63599
|
-
checkTypeRelatedToDepth--;
|
|
63600
|
-
if (checkTypeRelatedToDepth === 0) {
|
|
63601
|
-
checkTypeRelatedToCurrentlyVisitingMap = void 0;
|
|
63602
|
-
} else {
|
|
63603
|
-
const got = checkTypeRelatedToCurrentlyVisitingMap.get(visitingKey);
|
|
63604
|
-
if (got) {
|
|
63605
|
-
if (got === 1)
|
|
63606
|
-
checkTypeRelatedToCurrentlyVisitingMap.delete(visitingKey);
|
|
63607
|
-
else
|
|
63608
|
-
checkTypeRelatedToCurrentlyVisitingMap.set(visitingKey, got - 1);
|
|
63609
|
-
}
|
|
63610
|
-
}
|
|
63611
63559
|
return result !== 0 /* False */;
|
|
63612
63560
|
function resetErrorInfo(saved) {
|
|
63613
63561
|
errorInfo = saved.errorInfo;
|
|
@@ -64094,112 +64042,6 @@ ${lanes.join("\n")}
|
|
|
64094
64042
|
function shouldCheckAsExcessProperty(prop, container) {
|
|
64095
64043
|
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
|
|
64096
64044
|
}
|
|
64097
|
-
function checkOverloadsRelatedToIntersection(source2, target2, _reportErrors) {
|
|
64098
|
-
const sourceSignatures = getSignaturesOfType(source2, 0 /* Call */);
|
|
64099
|
-
const constructSignatureToString = (signature, forceReturnType) => {
|
|
64100
|
-
const origReturnType = signature.resolvedReturnType;
|
|
64101
|
-
signature.resolvedReturnType = forceReturnType;
|
|
64102
|
-
const str = signatureToString(
|
|
64103
|
-
signature,
|
|
64104
|
-
/*enclosingDeclaration*/
|
|
64105
|
-
void 0,
|
|
64106
|
-
262144 /* WriteArrowStyleSignature */,
|
|
64107
|
-
0 /* Call */
|
|
64108
|
-
);
|
|
64109
|
-
signature.resolvedReturnType = origReturnType;
|
|
64110
|
-
return str;
|
|
64111
|
-
};
|
|
64112
|
-
const mapAssignedToBy = /* @__PURE__ */ new Map();
|
|
64113
|
-
const failed = sourceSignatures.some((ssig, _si) => {
|
|
64114
|
-
if (getReturnTypeOfSignature(ssig) === neverType)
|
|
64115
|
-
return false;
|
|
64116
|
-
const accum = {
|
|
64117
|
-
hadMatch: false,
|
|
64118
|
-
gReturn: neverType,
|
|
64119
|
-
gReturnAllVoid: true
|
|
64120
|
-
};
|
|
64121
|
-
const matchedTargetSigs = [];
|
|
64122
|
-
target2.types.forEach((targetMember, _tti) => {
|
|
64123
|
-
const targetSignatures = getSignaturesOfType(targetMember, 0 /* Call */);
|
|
64124
|
-
targetSignatures.forEach((tsig, _ti) => {
|
|
64125
|
-
const targetReturnType = getReturnTypeOfSignature(tsig);
|
|
64126
|
-
if (compareSignaturesRelated(
|
|
64127
|
-
ssig,
|
|
64128
|
-
tsig,
|
|
64129
|
-
0 /* None */ | 4 /* IgnoreReturnTypes */,
|
|
64130
|
-
/*reportErrors*/
|
|
64131
|
-
false,
|
|
64132
|
-
/*errorReporter*/
|
|
64133
|
-
void 0,
|
|
64134
|
-
/*incompatibleErrorReporter*/
|
|
64135
|
-
void 0,
|
|
64136
|
-
compareTypesIdentical,
|
|
64137
|
-
// compareTypesAssignable,
|
|
64138
|
-
/*reportUnreliableMarkers*/
|
|
64139
|
-
void 0,
|
|
64140
|
-
/*compareTypesUnilaterally*/
|
|
64141
|
-
true
|
|
64142
|
-
) === -1 /* True */) {
|
|
64143
|
-
accum.hadMatch = true;
|
|
64144
|
-
if (targetReturnType !== voidType) {
|
|
64145
|
-
accum.gReturn = getUnionType([accum.gReturn, targetReturnType]);
|
|
64146
|
-
accum.gReturnAllVoid = false;
|
|
64147
|
-
}
|
|
64148
|
-
matchedTargetSigs.push(tsig);
|
|
64149
|
-
let mtti = mapAssignedToBy.get(_tti);
|
|
64150
|
-
if (!mtti) {
|
|
64151
|
-
mtti = /* @__PURE__ */ new Map();
|
|
64152
|
-
mapAssignedToBy.set(_tti, mtti);
|
|
64153
|
-
}
|
|
64154
|
-
const setsi = mtti.get(_ti);
|
|
64155
|
-
if (!setsi) {
|
|
64156
|
-
mtti.set(_ti, true);
|
|
64157
|
-
}
|
|
64158
|
-
}
|
|
64159
|
-
});
|
|
64160
|
-
});
|
|
64161
|
-
if (!accum.hadMatch) {
|
|
64162
|
-
if (_reportErrors) {
|
|
64163
|
-
resetErrorInfo({ skipParentCounter: 0 });
|
|
64164
|
-
reportError(Diagnostics.Parameters_of_signature_0_are_not_assignable_to_the_parameters_of_any_signature_in_type_1, constructSignatureToString(ssig), typeToString(target2));
|
|
64165
|
-
}
|
|
64166
|
-
return true;
|
|
64167
|
-
} else {
|
|
64168
|
-
const returnType = getReturnTypeOfSignature(ssig);
|
|
64169
|
-
if (!accum.gReturnAllVoid && !isTypeAssignableTo(returnType, accum.gReturn)) {
|
|
64170
|
-
if (_reportErrors) {
|
|
64171
|
-
resetErrorInfo({ skipParentCounter: 0 });
|
|
64172
|
-
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, typeToString(returnType), typeToString(accum.gReturn));
|
|
64173
|
-
const strset = /* @__PURE__ */ new Set();
|
|
64174
|
-
matchedTargetSigs.forEach((tsig) => strset.add(constructSignatureToString(tsig)));
|
|
64175
|
-
const strarr = [];
|
|
64176
|
-
strset.forEach((tstr) => strarr.push(tstr));
|
|
64177
|
-
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(ssig), strarr.join(" | "));
|
|
64178
|
-
}
|
|
64179
|
-
return true;
|
|
64180
|
-
}
|
|
64181
|
-
}
|
|
64182
|
-
});
|
|
64183
|
-
if (failed)
|
|
64184
|
-
return { computed: true, ternary: 0 /* False */ };
|
|
64185
|
-
const failed2 = target2.types.some((targetMember, _tti) => {
|
|
64186
|
-
const mtti = mapAssignedToBy.get(_tti);
|
|
64187
|
-
const targetSignatures = getSignaturesOfType(targetMember, 0 /* Call */);
|
|
64188
|
-
return targetSignatures.some((tsig, _ti) => {
|
|
64189
|
-
if (!mtti || !mtti.get(_ti)) {
|
|
64190
|
-
if (_reportErrors) {
|
|
64191
|
-
resetErrorInfo({ skipParentCounter: 0 });
|
|
64192
|
-
reportError(Diagnostics.There_is_no_signature_in_type_0_such_that_its_parameters_are_assignable_to_the_parameters_of_signature_1, typeToString(source2), constructSignatureToString(tsig, anyType));
|
|
64193
|
-
reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, typeToString(source2), typeToString(targetMember));
|
|
64194
|
-
}
|
|
64195
|
-
return true;
|
|
64196
|
-
}
|
|
64197
|
-
});
|
|
64198
|
-
});
|
|
64199
|
-
if (failed2)
|
|
64200
|
-
return { computed: true, ternary: 0 /* False */ };
|
|
64201
|
-
return { computed: true, ternary: -1 /* True */ };
|
|
64202
|
-
}
|
|
64203
64045
|
function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
64204
64046
|
if (source2.flags & 1048576 /* Union */) {
|
|
64205
64047
|
if (target2.flags & 1048576 /* Union */) {
|
|
@@ -64218,22 +64060,7 @@ ${lanes.join("\n")}
|
|
|
64218
64060
|
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */) && !(target2.flags & 402784252 /* Primitive */), intersectionState);
|
|
64219
64061
|
}
|
|
64220
64062
|
if (target2.flags & 2097152 /* Intersection */) {
|
|
64221
|
-
|
|
64222
|
-
if (result1 === 0 /* False */) {
|
|
64223
|
-
const sourceSignatures = getSignaturesOfType(source2, 0 /* Call */);
|
|
64224
|
-
if (sourceSignatures.every((sourceSig) => {
|
|
64225
|
-
return !sourceSig.typeParameters;
|
|
64226
|
-
})) {
|
|
64227
|
-
if (source2.flags & 524288 /* Object */ && getSignaturesOfType(source2, 0 /* Call */).length > 1) {
|
|
64228
|
-
const { computed, ternary } = checkOverloadsRelatedToIntersection(source2, target2, reportErrors2);
|
|
64229
|
-
if (computed) {
|
|
64230
|
-
Debug.assert(ternary === -1 /* True */ || ternary === 0 /* False */);
|
|
64231
|
-
return ternary;
|
|
64232
|
-
}
|
|
64233
|
-
}
|
|
64234
|
-
}
|
|
64235
|
-
}
|
|
64236
|
-
return result1;
|
|
64063
|
+
return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */);
|
|
64237
64064
|
}
|
|
64238
64065
|
if (relation === comparableRelation && target2.flags & 402784252 /* Primitive */) {
|
|
64239
64066
|
const constraints = sameMap(source2.types, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(t) || unknownType : t);
|
|
@@ -159176,7 +159003,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159176
159003
|
let importAdder;
|
|
159177
159004
|
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
159178
159005
|
if (memberCompletionEntry) {
|
|
159179
|
-
({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry);
|
|
159006
|
+
({ insertText, filterText, isSnippet, importAdder, replacementSpan } = memberCompletionEntry);
|
|
159180
159007
|
if (importAdder == null ? void 0 : importAdder.hasFixes()) {
|
|
159181
159008
|
hasAction = true;
|
|
159182
159009
|
source = "ClassMemberSnippet/" /* ClassMemberSnippet */;
|
|
@@ -159364,7 +159191,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159364
159191
|
);
|
|
159365
159192
|
}
|
|
159366
159193
|
}
|
|
159367
|
-
return { insertText, filterText, isSnippet, importAdder, eraseRange };
|
|
159194
|
+
return { insertText, filterText, isSnippet, importAdder, replacementSpan: eraseRange && createTextSpanFromBounds(eraseRange.pos, eraseRange.end) };
|
|
159368
159195
|
}
|
|
159369
159196
|
function getPresentModifiers(contextToken, sourceFile, position) {
|
|
159370
159197
|
if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) {
|
|
@@ -160016,7 +159843,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160016
159843
|
}
|
|
160017
159844
|
}
|
|
160018
159845
|
if (source === "ClassMemberSnippet/" /* ClassMemberSnippet */) {
|
|
160019
|
-
const { importAdder,
|
|
159846
|
+
const { importAdder, replacementSpan } = getEntryForMemberCompletion(
|
|
160020
159847
|
host,
|
|
160021
159848
|
program,
|
|
160022
159849
|
compilerOptions,
|
|
@@ -160028,15 +159855,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160028
159855
|
contextToken,
|
|
160029
159856
|
formatContext
|
|
160030
159857
|
);
|
|
160031
|
-
if (importAdder ||
|
|
159858
|
+
if (importAdder || replacementSpan) {
|
|
160032
159859
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
160033
159860
|
{ host, formatContext, preferences },
|
|
160034
159861
|
(tracker) => {
|
|
160035
159862
|
if (importAdder) {
|
|
160036
159863
|
importAdder.writeFixes(tracker);
|
|
160037
159864
|
}
|
|
160038
|
-
if (
|
|
160039
|
-
tracker.deleteRange(sourceFile,
|
|
159865
|
+
if (replacementSpan) {
|
|
159866
|
+
tracker.deleteRange(sourceFile, { pos: replacementSpan.start, end: replacementSpan.start + replacementSpan.length });
|
|
160040
159867
|
}
|
|
160041
159868
|
}
|
|
160042
159869
|
);
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.5";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20240223`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -7186,9 +7186,7 @@ var Diagnostics = {
|
|
|
7186
7186
|
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
7187
7187
|
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'"),
|
|
7188
7188
|
Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."),
|
|
7189
|
-
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
|
|
7190
|
-
There_is_no_signature_in_type_0_such_that_its_parameters_are_assignable_to_the_parameters_of_signature_1: diag(18055, 1 /* Error */, "There_is_no_signature_in_type_0_such_that_its_parameters_are_assignable_to_the_parameters_of_signatu_18055", "There is no signature in type {0} such that its parameters are assignable to the parameters of signature {1}"),
|
|
7191
|
-
Parameters_of_signature_0_are_not_assignable_to_the_parameters_of_any_signature_in_type_1: diag(18056, 1 /* Error */, "Parameters_of_signature_0_are_not_assignable_to_the_parameters_of_any_signature_in_type_1_18056", "Parameters of signature {0} are not assignable to the parameters of any signature in type {1}")
|
|
7189
|
+
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
|
|
7192
7190
|
};
|
|
7193
7191
|
|
|
7194
7192
|
// src/compiler/scanner.ts
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.5.0-pr-
|
|
5
|
+
"version": "5.5.0-pr-57480-2",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "f882d281482b734527fece6d31cfff99a8813730"
|
|
118
118
|
}
|