@typescript-deploys/pr-build 5.1.0-pr-53134-21 → 5.1.0-pr-53098-13
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/ThirdPartyNoticeText.txt +13 -13
- package/lib/lib.dom.d.ts +743 -16
- package/lib/lib.dom.iterable.d.ts +28 -0
- package/lib/lib.es5.d.ts +0 -6
- package/lib/lib.webworker.d.ts +577 -4
- package/lib/lib.webworker.iterable.d.ts +28 -0
- package/lib/tsc.js +50 -68
- package/lib/tsserver.js +64 -75
- package/lib/tsserverlibrary.d.ts +0 -1
- package/lib/tsserverlibrary.js +62 -72
- package/lib/typescript.d.ts +0 -1
- package/lib/typescript.js +61 -71
- package/lib/typingsInstaller.js +2 -18
- package/package.json +3 -3
|
@@ -20,6 +20,27 @@ and limitations under the License.
|
|
|
20
20
|
/// Worker Iterable APIs
|
|
21
21
|
/////////////////////////////
|
|
22
22
|
|
|
23
|
+
interface CSSNumericArray {
|
|
24
|
+
[Symbol.iterator](): IterableIterator<CSSNumericValue>;
|
|
25
|
+
entries(): IterableIterator<[number, CSSNumericValue]>;
|
|
26
|
+
keys(): IterableIterator<number>;
|
|
27
|
+
values(): IterableIterator<CSSNumericValue>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface CSSTransformValue {
|
|
31
|
+
[Symbol.iterator](): IterableIterator<CSSTransformComponent>;
|
|
32
|
+
entries(): IterableIterator<[number, CSSTransformComponent]>;
|
|
33
|
+
keys(): IterableIterator<number>;
|
|
34
|
+
values(): IterableIterator<CSSTransformComponent>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface CSSUnparsedValue {
|
|
38
|
+
[Symbol.iterator](): IterableIterator<CSSUnparsedSegment>;
|
|
39
|
+
entries(): IterableIterator<[number, CSSUnparsedSegment]>;
|
|
40
|
+
keys(): IterableIterator<number>;
|
|
41
|
+
values(): IterableIterator<CSSUnparsedSegment>;
|
|
42
|
+
}
|
|
43
|
+
|
|
23
44
|
interface Cache {
|
|
24
45
|
addAll(requests: Iterable<RequestInfo>): Promise<void>;
|
|
25
46
|
}
|
|
@@ -82,6 +103,13 @@ interface MessageEvent<T = any> {
|
|
|
82
103
|
initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
|
|
83
104
|
}
|
|
84
105
|
|
|
106
|
+
interface StylePropertyMapReadOnly {
|
|
107
|
+
[Symbol.iterator](): IterableIterator<[string, Iterable<CSSStyleValue>]>;
|
|
108
|
+
entries(): IterableIterator<[string, Iterable<CSSStyleValue>]>;
|
|
109
|
+
keys(): IterableIterator<string>;
|
|
110
|
+
values(): IterableIterator<Iterable<CSSStyleValue>>;
|
|
111
|
+
}
|
|
112
|
+
|
|
85
113
|
interface SubtleCrypto {
|
|
86
114
|
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
|
|
87
115
|
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
|
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.1";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230310`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -4876,20 +4876,6 @@ function patchWriteFileEnsuringDirectory(sys2) {
|
|
|
4876
4876
|
(path2) => sys2.directoryExists(path2)
|
|
4877
4877
|
);
|
|
4878
4878
|
}
|
|
4879
|
-
function getNodeMajorVersion() {
|
|
4880
|
-
if (typeof process === "undefined") {
|
|
4881
|
-
return void 0;
|
|
4882
|
-
}
|
|
4883
|
-
const version2 = process.version;
|
|
4884
|
-
if (!version2) {
|
|
4885
|
-
return void 0;
|
|
4886
|
-
}
|
|
4887
|
-
const dot = version2.indexOf(".");
|
|
4888
|
-
if (dot === -1) {
|
|
4889
|
-
return void 0;
|
|
4890
|
-
}
|
|
4891
|
-
return parseInt(version2.substring(1, dot));
|
|
4892
|
-
}
|
|
4893
4879
|
var sys = (() => {
|
|
4894
4880
|
const byteOrderMarkIndicator = "\uFEFF";
|
|
4895
4881
|
function getNodeSystem() {
|
|
@@ -4906,14 +4892,12 @@ var sys = (() => {
|
|
|
4906
4892
|
let activeSession;
|
|
4907
4893
|
let profilePath = "./profile.cpuprofile";
|
|
4908
4894
|
const Buffer2 = require("buffer").Buffer;
|
|
4909
|
-
const nodeVersion = getNodeMajorVersion();
|
|
4910
|
-
const isNode4OrLater = nodeVersion >= 4;
|
|
4911
4895
|
const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
4912
4896
|
const platform = _os.platform();
|
|
4913
4897
|
const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
4914
4898
|
const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
4915
4899
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
4916
|
-
const fsSupportsRecursiveFsWatch =
|
|
4900
|
+
const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
|
|
4917
4901
|
const getCurrentDirectory = memoize(() => process.cwd());
|
|
4918
4902
|
const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
|
|
4919
4903
|
pollingWatchFileWorker: fsWatchFileWorker,
|
|
@@ -42691,6 +42675,7 @@ function createTypeChecker(host) {
|
|
|
42691
42675
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
42692
42676
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
42693
42677
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
42678
|
+
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
42694
42679
|
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
|
|
42695
42680
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
42696
42681
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
@@ -52679,10 +52664,9 @@ function createTypeChecker(host) {
|
|
|
52679
52664
|
return [sig.parameters];
|
|
52680
52665
|
function expandSignatureParametersWithTupleMembers(restType, restIndex) {
|
|
52681
52666
|
const elementTypes = getTypeArguments(restType);
|
|
52682
|
-
const associatedNames = restType
|
|
52667
|
+
const associatedNames = getUniqAssociatedNamesFromTupleType(restType);
|
|
52683
52668
|
const restParams = map(elementTypes, (t, i) => {
|
|
52684
|
-
const
|
|
52685
|
-
const name = tupleLabelName || getParameterNameAtPosition(sig, restIndex + i, restType);
|
|
52669
|
+
const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType);
|
|
52686
52670
|
const flags = restType.target.elementFlags[i];
|
|
52687
52671
|
const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;
|
|
52688
52672
|
const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);
|
|
@@ -52691,6 +52675,20 @@ function createTypeChecker(host) {
|
|
|
52691
52675
|
});
|
|
52692
52676
|
return concatenate(sig.parameters.slice(0, restIndex), restParams);
|
|
52693
52677
|
}
|
|
52678
|
+
function getUniqAssociatedNamesFromTupleType(type) {
|
|
52679
|
+
const associatedNamesMap = /* @__PURE__ */ new Map();
|
|
52680
|
+
return map(type.target.labeledElementDeclarations, (labeledElement) => {
|
|
52681
|
+
const name = getTupleElementLabel(labeledElement);
|
|
52682
|
+
const prevCounter = associatedNamesMap.get(name);
|
|
52683
|
+
if (prevCounter === void 0) {
|
|
52684
|
+
associatedNamesMap.set(name, 1);
|
|
52685
|
+
return name;
|
|
52686
|
+
} else {
|
|
52687
|
+
associatedNamesMap.set(name, prevCounter + 1);
|
|
52688
|
+
return `${name}_${prevCounter}`;
|
|
52689
|
+
}
|
|
52690
|
+
});
|
|
52691
|
+
}
|
|
52694
52692
|
}
|
|
52695
52693
|
function getDefaultConstructSignatures(classType) {
|
|
52696
52694
|
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
@@ -53946,6 +53944,13 @@ function createTypeChecker(host) {
|
|
|
53946
53944
|
function isConflictingPrivateProperty(prop) {
|
|
53947
53945
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
53948
53946
|
}
|
|
53947
|
+
function isGenericReducibleType(type) {
|
|
53948
|
+
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
53949
|
+
}
|
|
53950
|
+
function isReducibleIntersection(type) {
|
|
53951
|
+
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
53952
|
+
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
53953
|
+
}
|
|
53949
53954
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
53950
53955
|
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 33554432 /* IsNeverIntersection */) {
|
|
53951
53956
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
@@ -55388,7 +55393,7 @@ function createTypeChecker(host) {
|
|
|
55388
55393
|
}
|
|
55389
55394
|
function getGlobalOmitSymbol() {
|
|
55390
55395
|
deferredGlobalOmitSymbol || (deferredGlobalOmitSymbol = getGlobalTypeAliasSymbol(
|
|
55391
|
-
"
|
|
55396
|
+
"Omit",
|
|
55392
55397
|
/*arity*/
|
|
55393
55398
|
2,
|
|
55394
55399
|
/*reportErrors*/
|
|
@@ -56315,10 +56320,10 @@ function createTypeChecker(host) {
|
|
|
56315
56320
|
}
|
|
56316
56321
|
return links.resolvedType;
|
|
56317
56322
|
}
|
|
56318
|
-
function createIndexType(type,
|
|
56323
|
+
function createIndexType(type, indexFlags) {
|
|
56319
56324
|
const result = createType(4194304 /* Index */);
|
|
56320
56325
|
result.type = type;
|
|
56321
|
-
result.
|
|
56326
|
+
result.indexFlags = indexFlags;
|
|
56322
56327
|
return result;
|
|
56323
56328
|
}
|
|
56324
56329
|
function createOriginIndexType(type) {
|
|
@@ -56326,31 +56331,23 @@ function createTypeChecker(host) {
|
|
|
56326
56331
|
result.type = type;
|
|
56327
56332
|
return result;
|
|
56328
56333
|
}
|
|
56329
|
-
function getIndexTypeForGenericType(type,
|
|
56330
|
-
return
|
|
56331
|
-
type,
|
|
56332
|
-
/*stringsOnly*/
|
|
56333
|
-
true
|
|
56334
|
-
)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(
|
|
56335
|
-
type,
|
|
56336
|
-
/*stringsOnly*/
|
|
56337
|
-
false
|
|
56338
|
-
));
|
|
56334
|
+
function getIndexTypeForGenericType(type, indexFlags) {
|
|
56335
|
+
return indexFlags & 1 /* StringsOnly */ ? type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, 1 /* StringsOnly */)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, 0 /* None */));
|
|
56339
56336
|
}
|
|
56340
|
-
function getIndexTypeForMappedType(type,
|
|
56337
|
+
function getIndexTypeForMappedType(type, indexFlags) {
|
|
56341
56338
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
56342
56339
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
56343
56340
|
const nameType = getNameTypeFromMappedType(type.target || type);
|
|
56344
|
-
if (!nameType && !
|
|
56341
|
+
if (!nameType && !(indexFlags & 2 /* NoIndexSignatures */)) {
|
|
56345
56342
|
return constraintType;
|
|
56346
56343
|
}
|
|
56347
56344
|
const keyTypes = [];
|
|
56348
56345
|
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
56349
56346
|
if (!isGenericIndexType(constraintType)) {
|
|
56350
56347
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
56351
|
-
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */,
|
|
56348
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, !!(indexFlags & 1 /* StringsOnly */), addMemberForKeyType);
|
|
56352
56349
|
} else {
|
|
56353
|
-
return getIndexTypeForGenericType(type,
|
|
56350
|
+
return getIndexTypeForGenericType(type, indexFlags);
|
|
56354
56351
|
}
|
|
56355
56352
|
} else {
|
|
56356
56353
|
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
@@ -56358,7 +56355,7 @@ function createTypeChecker(host) {
|
|
|
56358
56355
|
if (isGenericIndexType(constraintType)) {
|
|
56359
56356
|
forEachType(constraintType, addMemberForKeyType);
|
|
56360
56357
|
}
|
|
56361
|
-
const result =
|
|
56358
|
+
const result = indexFlags & 2 /* NoIndexSignatures */ ? filterType(getUnionType(keyTypes), (t) => !(t.flags & (1 /* Any */ | 4 /* String */))) : getUnionType(keyTypes);
|
|
56362
56359
|
if (result.flags & 1048576 /* Union */ && constraintType.flags & 1048576 /* Union */ && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
|
|
56363
56360
|
return constraintType;
|
|
56364
56361
|
}
|
|
@@ -56411,19 +56408,15 @@ function createTypeChecker(host) {
|
|
|
56411
56408
|
origin
|
|
56412
56409
|
);
|
|
56413
56410
|
}
|
|
56414
|
-
function
|
|
56415
|
-
|
|
56416
|
-
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
56417
|
-
}
|
|
56418
|
-
function shouldDeferIndexType(type) {
|
|
56419
|
-
return !!(type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) || type.flags & 1048576 /* Union */ && some(type.types, isPossiblyReducibleByInstantiation) || type.flags & 2097152 /* Intersection */ && maybeTypeOfKind(type, 465829888 /* Instantiable */) && some(type.types, isEmptyAnonymousObjectType));
|
|
56411
|
+
function shouldDeferIndexType(type, indexFlags = 0 /* None */) {
|
|
56412
|
+
return !!(type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) || type.flags & 1048576 /* Union */ && !(indexFlags & 4 /* NoReducibleCheck */) && isGenericReducibleType(type) || type.flags & 2097152 /* Intersection */ && maybeTypeOfKind(type, 465829888 /* Instantiable */) && some(type.types, isEmptyAnonymousObjectType));
|
|
56420
56413
|
}
|
|
56421
|
-
function getIndexType(type,
|
|
56414
|
+
function getIndexType(type, indexFlags = defaultIndexFlags) {
|
|
56422
56415
|
type = getReducedType(type);
|
|
56423
|
-
return shouldDeferIndexType(type) ? getIndexTypeForGenericType(type,
|
|
56416
|
+
return shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(
|
|
56424
56417
|
type,
|
|
56425
|
-
(
|
|
56426
|
-
|
|
56418
|
+
(indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */),
|
|
56419
|
+
indexFlags === defaultIndexFlags
|
|
56427
56420
|
);
|
|
56428
56421
|
}
|
|
56429
56422
|
function getExtractStringType(type) {
|
|
@@ -56963,12 +56956,13 @@ function createTypeChecker(host) {
|
|
|
56963
56956
|
if (objectType === wildcardType || indexType === wildcardType) {
|
|
56964
56957
|
return wildcardType;
|
|
56965
56958
|
}
|
|
56959
|
+
objectType = getReducedType(objectType);
|
|
56966
56960
|
if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
|
|
56967
56961
|
indexType = stringType;
|
|
56968
56962
|
}
|
|
56969
56963
|
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
56970
56964
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
56971
|
-
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 197 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
|
|
56965
|
+
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 197 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)) || isGenericReducibleType(objectType))) {
|
|
56972
56966
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
56973
56967
|
return objectType;
|
|
56974
56968
|
}
|
|
@@ -58154,9 +58148,6 @@ function createTypeChecker(host) {
|
|
|
58154
58148
|
}
|
|
58155
58149
|
return type;
|
|
58156
58150
|
}
|
|
58157
|
-
function getUniqueLiteralFilledInstantiation(type) {
|
|
58158
|
-
return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
58159
|
-
}
|
|
58160
58151
|
function getPermissiveInstantiation(type) {
|
|
58161
58152
|
return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
|
|
58162
58153
|
}
|
|
@@ -60351,7 +60342,7 @@ function createTypeChecker(host) {
|
|
|
60351
60342
|
} else {
|
|
60352
60343
|
const constraint = getSimplifiedTypeOrConstraint(targetType);
|
|
60353
60344
|
if (constraint) {
|
|
60354
|
-
if (isRelatedTo(source2, getIndexType(constraint, target2.
|
|
60345
|
+
if (isRelatedTo(source2, getIndexType(constraint, target2.indexFlags | 4 /* NoReducibleCheck */), 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
60355
60346
|
return -1 /* True */;
|
|
60356
60347
|
}
|
|
60357
60348
|
} else if (isGenericMappedType(targetType)) {
|
|
@@ -60432,13 +60423,7 @@ function createTypeChecker(host) {
|
|
|
60432
60423
|
}
|
|
60433
60424
|
if (!isGenericMappedType(source2)) {
|
|
60434
60425
|
const targetKeys = keysRemapped ? getNameTypeFromMappedType(target2) : getConstraintTypeFromMappedType(target2);
|
|
60435
|
-
const sourceKeys = getIndexType(
|
|
60436
|
-
source2,
|
|
60437
|
-
/*stringsOnly*/
|
|
60438
|
-
void 0,
|
|
60439
|
-
/*noIndexSignatures*/
|
|
60440
|
-
true
|
|
60441
|
-
);
|
|
60426
|
+
const sourceKeys = getIndexType(source2, 2 /* NoIndexSignatures */);
|
|
60442
60427
|
const includeOptional = modifiers & 4 /* IncludeOptional */;
|
|
60443
60428
|
const filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : void 0;
|
|
60444
60429
|
if (includeOptional ? !(filteredByApplicability.flags & 131072 /* Never */) : isRelatedTo(targetKeys, sourceKeys, 3 /* Both */)) {
|
|
@@ -67270,13 +67255,14 @@ function createTypeChecker(host) {
|
|
|
67270
67255
|
const elementFlags = [];
|
|
67271
67256
|
pushCachedContextualType(node);
|
|
67272
67257
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
67273
|
-
const
|
|
67258
|
+
const isSpreadIntoCallOrNew = isSpreadElement(node.parent) && isCallOrNewExpression(node.parent.parent);
|
|
67259
|
+
const inConstContext = isSpreadIntoCallOrNew || isConstContext(node);
|
|
67274
67260
|
const contextualType = getApparentTypeOfContextualType(
|
|
67275
67261
|
node,
|
|
67276
67262
|
/*contextFlags*/
|
|
67277
67263
|
void 0
|
|
67278
67264
|
);
|
|
67279
|
-
const inTupleContext = !!contextualType && someType(contextualType, isTupleLikeType);
|
|
67265
|
+
const inTupleContext = isSpreadIntoCallOrNew || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
67280
67266
|
let hasOmittedExpression = false;
|
|
67281
67267
|
for (let i = 0; i < elementCount; i++) {
|
|
67282
67268
|
const e = elements[i];
|
|
@@ -74670,11 +74656,7 @@ function createTypeChecker(host) {
|
|
|
74670
74656
|
}
|
|
74671
74657
|
const objectType = type.objectType;
|
|
74672
74658
|
const indexType = type.indexType;
|
|
74673
|
-
if (isTypeAssignableTo(indexType, getIndexType(
|
|
74674
|
-
objectType,
|
|
74675
|
-
/*stringsOnly*/
|
|
74676
|
-
false
|
|
74677
|
-
))) {
|
|
74659
|
+
if (isTypeAssignableTo(indexType, getIndexType(objectType, 0 /* None */))) {
|
|
74678
74660
|
if (accessNode.kind === 210 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
|
|
74679
74661
|
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
|
|
74680
74662
|
}
|