@typescript-deploys/pr-build 5.2.0-pr-55152-2 → 5.2.0-pr-52095-19
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 +65 -40
- package/lib/tsserver.js +65 -40
- package/lib/tsserverlibrary.js +65 -40
- package/lib/typescript.js +65 -40
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -59803,7 +59803,6 @@ function createTypeChecker(host) {
|
|
|
59803
59803
|
let overrideNextErrorInfo = 0;
|
|
59804
59804
|
let lastSkippedInfo;
|
|
59805
59805
|
let incompatibleStack;
|
|
59806
|
-
let skipParentCounter = 0;
|
|
59807
59806
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
59808
59807
|
const result = isRelatedTo(
|
|
59809
59808
|
source,
|
|
@@ -59979,15 +59978,7 @@ function createTypeChecker(host) {
|
|
|
59979
59978
|
reportIncompatibleStack();
|
|
59980
59979
|
if (message.elidedInCompatabilityPyramid)
|
|
59981
59980
|
return;
|
|
59982
|
-
|
|
59983
|
-
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
59984
|
-
} else {
|
|
59985
|
-
skipParentCounter--;
|
|
59986
|
-
}
|
|
59987
|
-
}
|
|
59988
|
-
function reportParentSkippedError(message, ...args) {
|
|
59989
|
-
reportError(message, ...args);
|
|
59990
|
-
skipParentCounter++;
|
|
59981
|
+
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
59991
59982
|
}
|
|
59992
59983
|
function associateRelatedInfo(info) {
|
|
59993
59984
|
Debug.assert(!!errorInfo);
|
|
@@ -60324,14 +60315,14 @@ function createTypeChecker(host) {
|
|
|
60324
60315
|
}
|
|
60325
60316
|
}
|
|
60326
60317
|
if (suggestion !== void 0) {
|
|
60327
|
-
|
|
60318
|
+
reportError(
|
|
60328
60319
|
Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
|
|
60329
60320
|
symbolToString(prop),
|
|
60330
60321
|
typeToString(errorTarget),
|
|
60331
60322
|
suggestion
|
|
60332
60323
|
);
|
|
60333
60324
|
} else {
|
|
60334
|
-
|
|
60325
|
+
reportError(
|
|
60335
60326
|
Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
|
|
60336
60327
|
symbolToString(prop),
|
|
60337
60328
|
typeToString(errorTarget)
|
|
@@ -67262,41 +67253,75 @@ function createTypeChecker(host) {
|
|
|
67262
67253
|
return mapType(
|
|
67263
67254
|
type,
|
|
67264
67255
|
(t) => {
|
|
67265
|
-
|
|
67266
|
-
|
|
67267
|
-
|
|
67268
|
-
|
|
67269
|
-
const
|
|
67270
|
-
|
|
67271
|
-
|
|
67272
|
-
|
|
67273
|
-
|
|
67274
|
-
|
|
67275
|
-
|
|
67276
|
-
|
|
67277
|
-
}
|
|
67278
|
-
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
67279
|
-
const restType = getElementTypeOfSliceOfTupleType(
|
|
67280
|
-
t,
|
|
67281
|
-
t.target.fixedLength,
|
|
67282
|
-
/*endSkipCount*/
|
|
67283
|
-
0,
|
|
67284
|
-
/*writing*/
|
|
67285
|
-
false,
|
|
67286
|
-
/*noReductions*/
|
|
67287
|
-
true
|
|
67288
|
-
);
|
|
67289
|
-
if (restType) {
|
|
67290
|
-
return restType;
|
|
67256
|
+
if (!(t.flags & 3670016 /* StructuredType */)) {
|
|
67257
|
+
return void 0;
|
|
67258
|
+
}
|
|
67259
|
+
if (t.flags & 2097152 /* Intersection */) {
|
|
67260
|
+
const intersection = t;
|
|
67261
|
+
let applicableIndexedMappedTypeSubstitions;
|
|
67262
|
+
let concretePropertyTypes;
|
|
67263
|
+
let applicableIndexInfoCandidates;
|
|
67264
|
+
for (const t2 of intersection.types) {
|
|
67265
|
+
if (isGenericMappedType(t2) && !t2.declaration.nameType) {
|
|
67266
|
+
applicableIndexedMappedTypeSubstitions = append(applicableIndexedMappedTypeSubstitions, getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t2));
|
|
67267
|
+
continue;
|
|
67291
67268
|
}
|
|
67269
|
+
const typeOfConcreteProperty = getTypeOfConcretePropertyOfContextualType(t2);
|
|
67270
|
+
if (typeOfConcreteProperty) {
|
|
67271
|
+
concretePropertyTypes = append(concretePropertyTypes, typeOfConcreteProperty);
|
|
67272
|
+
continue;
|
|
67273
|
+
}
|
|
67274
|
+
applicableIndexInfoCandidates = append(applicableIndexInfoCandidates, t2);
|
|
67275
|
+
}
|
|
67276
|
+
if (concretePropertyTypes) {
|
|
67277
|
+
return getIntersectionType(concatenate(concretePropertyTypes, applicableIndexedMappedTypeSubstitions));
|
|
67292
67278
|
}
|
|
67293
|
-
|
|
67279
|
+
const types = concatenate(mapDefined(applicableIndexInfoCandidates, getTypeOfApplicableIndexInfoOfContextualType), applicableIndexedMappedTypeSubstitions);
|
|
67280
|
+
if (types.length > 0) {
|
|
67281
|
+
return getIntersectionType(types);
|
|
67282
|
+
}
|
|
67283
|
+
return void 0;
|
|
67294
67284
|
}
|
|
67295
|
-
return
|
|
67285
|
+
return isGenericMappedType(t) && !t.declaration.nameType ? getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) : getTypeOfConcretePropertyOfContextualType(t) || getTypeOfApplicableIndexInfoOfContextualType(t);
|
|
67296
67286
|
},
|
|
67297
67287
|
/*noReductions*/
|
|
67298
67288
|
true
|
|
67299
67289
|
);
|
|
67290
|
+
function getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) {
|
|
67291
|
+
const constraint = getConstraintTypeFromMappedType(t);
|
|
67292
|
+
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
67293
|
+
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
67294
|
+
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
67295
|
+
return substituteIndexedMappedType(t, propertyNameType);
|
|
67296
|
+
}
|
|
67297
|
+
return void 0;
|
|
67298
|
+
}
|
|
67299
|
+
function getTypeOfConcretePropertyOfContextualType(t) {
|
|
67300
|
+
const prop = getPropertyOfType(t, name);
|
|
67301
|
+
if (prop) {
|
|
67302
|
+
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
67303
|
+
}
|
|
67304
|
+
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
67305
|
+
const restType = getElementTypeOfSliceOfTupleType(
|
|
67306
|
+
t,
|
|
67307
|
+
t.target.fixedLength,
|
|
67308
|
+
/*endSkipCount*/
|
|
67309
|
+
0,
|
|
67310
|
+
/*writing*/
|
|
67311
|
+
false,
|
|
67312
|
+
/*noReductions*/
|
|
67313
|
+
true
|
|
67314
|
+
);
|
|
67315
|
+
if (restType) {
|
|
67316
|
+
return restType;
|
|
67317
|
+
}
|
|
67318
|
+
}
|
|
67319
|
+
return void 0;
|
|
67320
|
+
}
|
|
67321
|
+
function getTypeOfApplicableIndexInfoOfContextualType(t) {
|
|
67322
|
+
var _a;
|
|
67323
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
67324
|
+
}
|
|
67300
67325
|
}
|
|
67301
67326
|
function getContextualTypeForObjectLiteralMethod(node, contextFlags) {
|
|
67302
67327
|
Debug.assert(isObjectLiteralMethod(node));
|
package/lib/tsserver.js
CHANGED
|
@@ -64512,7 +64512,6 @@ function createTypeChecker(host) {
|
|
|
64512
64512
|
let overrideNextErrorInfo = 0;
|
|
64513
64513
|
let lastSkippedInfo;
|
|
64514
64514
|
let incompatibleStack;
|
|
64515
|
-
let skipParentCounter = 0;
|
|
64516
64515
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
64517
64516
|
const result = isRelatedTo(
|
|
64518
64517
|
source,
|
|
@@ -64688,15 +64687,7 @@ function createTypeChecker(host) {
|
|
|
64688
64687
|
reportIncompatibleStack();
|
|
64689
64688
|
if (message.elidedInCompatabilityPyramid)
|
|
64690
64689
|
return;
|
|
64691
|
-
|
|
64692
|
-
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
64693
|
-
} else {
|
|
64694
|
-
skipParentCounter--;
|
|
64695
|
-
}
|
|
64696
|
-
}
|
|
64697
|
-
function reportParentSkippedError(message, ...args) {
|
|
64698
|
-
reportError(message, ...args);
|
|
64699
|
-
skipParentCounter++;
|
|
64690
|
+
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
64700
64691
|
}
|
|
64701
64692
|
function associateRelatedInfo(info) {
|
|
64702
64693
|
Debug.assert(!!errorInfo);
|
|
@@ -65033,14 +65024,14 @@ function createTypeChecker(host) {
|
|
|
65033
65024
|
}
|
|
65034
65025
|
}
|
|
65035
65026
|
if (suggestion !== void 0) {
|
|
65036
|
-
|
|
65027
|
+
reportError(
|
|
65037
65028
|
Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
|
|
65038
65029
|
symbolToString(prop),
|
|
65039
65030
|
typeToString(errorTarget),
|
|
65040
65031
|
suggestion
|
|
65041
65032
|
);
|
|
65042
65033
|
} else {
|
|
65043
|
-
|
|
65034
|
+
reportError(
|
|
65044
65035
|
Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
|
|
65045
65036
|
symbolToString(prop),
|
|
65046
65037
|
typeToString(errorTarget)
|
|
@@ -71971,41 +71962,75 @@ function createTypeChecker(host) {
|
|
|
71971
71962
|
return mapType(
|
|
71972
71963
|
type,
|
|
71973
71964
|
(t) => {
|
|
71974
|
-
|
|
71975
|
-
|
|
71976
|
-
|
|
71977
|
-
|
|
71978
|
-
const
|
|
71979
|
-
|
|
71980
|
-
|
|
71981
|
-
|
|
71982
|
-
|
|
71983
|
-
|
|
71984
|
-
|
|
71985
|
-
|
|
71986
|
-
}
|
|
71987
|
-
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
71988
|
-
const restType = getElementTypeOfSliceOfTupleType(
|
|
71989
|
-
t,
|
|
71990
|
-
t.target.fixedLength,
|
|
71991
|
-
/*endSkipCount*/
|
|
71992
|
-
0,
|
|
71993
|
-
/*writing*/
|
|
71994
|
-
false,
|
|
71995
|
-
/*noReductions*/
|
|
71996
|
-
true
|
|
71997
|
-
);
|
|
71998
|
-
if (restType) {
|
|
71999
|
-
return restType;
|
|
71965
|
+
if (!(t.flags & 3670016 /* StructuredType */)) {
|
|
71966
|
+
return void 0;
|
|
71967
|
+
}
|
|
71968
|
+
if (t.flags & 2097152 /* Intersection */) {
|
|
71969
|
+
const intersection = t;
|
|
71970
|
+
let applicableIndexedMappedTypeSubstitions;
|
|
71971
|
+
let concretePropertyTypes;
|
|
71972
|
+
let applicableIndexInfoCandidates;
|
|
71973
|
+
for (const t2 of intersection.types) {
|
|
71974
|
+
if (isGenericMappedType(t2) && !t2.declaration.nameType) {
|
|
71975
|
+
applicableIndexedMappedTypeSubstitions = append(applicableIndexedMappedTypeSubstitions, getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t2));
|
|
71976
|
+
continue;
|
|
72000
71977
|
}
|
|
71978
|
+
const typeOfConcreteProperty = getTypeOfConcretePropertyOfContextualType(t2);
|
|
71979
|
+
if (typeOfConcreteProperty) {
|
|
71980
|
+
concretePropertyTypes = append(concretePropertyTypes, typeOfConcreteProperty);
|
|
71981
|
+
continue;
|
|
71982
|
+
}
|
|
71983
|
+
applicableIndexInfoCandidates = append(applicableIndexInfoCandidates, t2);
|
|
71984
|
+
}
|
|
71985
|
+
if (concretePropertyTypes) {
|
|
71986
|
+
return getIntersectionType(concatenate(concretePropertyTypes, applicableIndexedMappedTypeSubstitions));
|
|
72001
71987
|
}
|
|
72002
|
-
|
|
71988
|
+
const types = concatenate(mapDefined(applicableIndexInfoCandidates, getTypeOfApplicableIndexInfoOfContextualType), applicableIndexedMappedTypeSubstitions);
|
|
71989
|
+
if (types.length > 0) {
|
|
71990
|
+
return getIntersectionType(types);
|
|
71991
|
+
}
|
|
71992
|
+
return void 0;
|
|
72003
71993
|
}
|
|
72004
|
-
return
|
|
71994
|
+
return isGenericMappedType(t) && !t.declaration.nameType ? getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) : getTypeOfConcretePropertyOfContextualType(t) || getTypeOfApplicableIndexInfoOfContextualType(t);
|
|
72005
71995
|
},
|
|
72006
71996
|
/*noReductions*/
|
|
72007
71997
|
true
|
|
72008
71998
|
);
|
|
71999
|
+
function getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) {
|
|
72000
|
+
const constraint = getConstraintTypeFromMappedType(t);
|
|
72001
|
+
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
72002
|
+
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
72003
|
+
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
72004
|
+
return substituteIndexedMappedType(t, propertyNameType);
|
|
72005
|
+
}
|
|
72006
|
+
return void 0;
|
|
72007
|
+
}
|
|
72008
|
+
function getTypeOfConcretePropertyOfContextualType(t) {
|
|
72009
|
+
const prop = getPropertyOfType(t, name);
|
|
72010
|
+
if (prop) {
|
|
72011
|
+
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
72012
|
+
}
|
|
72013
|
+
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
72014
|
+
const restType = getElementTypeOfSliceOfTupleType(
|
|
72015
|
+
t,
|
|
72016
|
+
t.target.fixedLength,
|
|
72017
|
+
/*endSkipCount*/
|
|
72018
|
+
0,
|
|
72019
|
+
/*writing*/
|
|
72020
|
+
false,
|
|
72021
|
+
/*noReductions*/
|
|
72022
|
+
true
|
|
72023
|
+
);
|
|
72024
|
+
if (restType) {
|
|
72025
|
+
return restType;
|
|
72026
|
+
}
|
|
72027
|
+
}
|
|
72028
|
+
return void 0;
|
|
72029
|
+
}
|
|
72030
|
+
function getTypeOfApplicableIndexInfoOfContextualType(t) {
|
|
72031
|
+
var _a;
|
|
72032
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
72033
|
+
}
|
|
72009
72034
|
}
|
|
72010
72035
|
function getContextualTypeForObjectLiteralMethod(node, contextFlags) {
|
|
72011
72036
|
Debug.assert(isObjectLiteralMethod(node));
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -62277,7 +62277,6 @@ ${lanes.join("\n")}
|
|
|
62277
62277
|
let overrideNextErrorInfo = 0;
|
|
62278
62278
|
let lastSkippedInfo;
|
|
62279
62279
|
let incompatibleStack;
|
|
62280
|
-
let skipParentCounter = 0;
|
|
62281
62280
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
62282
62281
|
const result = isRelatedTo(
|
|
62283
62282
|
source,
|
|
@@ -62453,15 +62452,7 @@ ${lanes.join("\n")}
|
|
|
62453
62452
|
reportIncompatibleStack();
|
|
62454
62453
|
if (message.elidedInCompatabilityPyramid)
|
|
62455
62454
|
return;
|
|
62456
|
-
|
|
62457
|
-
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
62458
|
-
} else {
|
|
62459
|
-
skipParentCounter--;
|
|
62460
|
-
}
|
|
62461
|
-
}
|
|
62462
|
-
function reportParentSkippedError(message, ...args) {
|
|
62463
|
-
reportError(message, ...args);
|
|
62464
|
-
skipParentCounter++;
|
|
62455
|
+
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
62465
62456
|
}
|
|
62466
62457
|
function associateRelatedInfo(info) {
|
|
62467
62458
|
Debug.assert(!!errorInfo);
|
|
@@ -62798,14 +62789,14 @@ ${lanes.join("\n")}
|
|
|
62798
62789
|
}
|
|
62799
62790
|
}
|
|
62800
62791
|
if (suggestion !== void 0) {
|
|
62801
|
-
|
|
62792
|
+
reportError(
|
|
62802
62793
|
Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
|
|
62803
62794
|
symbolToString(prop),
|
|
62804
62795
|
typeToString(errorTarget),
|
|
62805
62796
|
suggestion
|
|
62806
62797
|
);
|
|
62807
62798
|
} else {
|
|
62808
|
-
|
|
62799
|
+
reportError(
|
|
62809
62800
|
Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
|
|
62810
62801
|
symbolToString(prop),
|
|
62811
62802
|
typeToString(errorTarget)
|
|
@@ -69736,41 +69727,75 @@ ${lanes.join("\n")}
|
|
|
69736
69727
|
return mapType(
|
|
69737
69728
|
type,
|
|
69738
69729
|
(t) => {
|
|
69739
|
-
|
|
69740
|
-
|
|
69741
|
-
|
|
69742
|
-
|
|
69743
|
-
const
|
|
69744
|
-
|
|
69745
|
-
|
|
69746
|
-
|
|
69747
|
-
|
|
69748
|
-
|
|
69749
|
-
|
|
69750
|
-
|
|
69751
|
-
}
|
|
69752
|
-
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
69753
|
-
const restType = getElementTypeOfSliceOfTupleType(
|
|
69754
|
-
t,
|
|
69755
|
-
t.target.fixedLength,
|
|
69756
|
-
/*endSkipCount*/
|
|
69757
|
-
0,
|
|
69758
|
-
/*writing*/
|
|
69759
|
-
false,
|
|
69760
|
-
/*noReductions*/
|
|
69761
|
-
true
|
|
69762
|
-
);
|
|
69763
|
-
if (restType) {
|
|
69764
|
-
return restType;
|
|
69730
|
+
if (!(t.flags & 3670016 /* StructuredType */)) {
|
|
69731
|
+
return void 0;
|
|
69732
|
+
}
|
|
69733
|
+
if (t.flags & 2097152 /* Intersection */) {
|
|
69734
|
+
const intersection = t;
|
|
69735
|
+
let applicableIndexedMappedTypeSubstitions;
|
|
69736
|
+
let concretePropertyTypes;
|
|
69737
|
+
let applicableIndexInfoCandidates;
|
|
69738
|
+
for (const t2 of intersection.types) {
|
|
69739
|
+
if (isGenericMappedType(t2) && !t2.declaration.nameType) {
|
|
69740
|
+
applicableIndexedMappedTypeSubstitions = append(applicableIndexedMappedTypeSubstitions, getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t2));
|
|
69741
|
+
continue;
|
|
69765
69742
|
}
|
|
69743
|
+
const typeOfConcreteProperty = getTypeOfConcretePropertyOfContextualType(t2);
|
|
69744
|
+
if (typeOfConcreteProperty) {
|
|
69745
|
+
concretePropertyTypes = append(concretePropertyTypes, typeOfConcreteProperty);
|
|
69746
|
+
continue;
|
|
69747
|
+
}
|
|
69748
|
+
applicableIndexInfoCandidates = append(applicableIndexInfoCandidates, t2);
|
|
69749
|
+
}
|
|
69750
|
+
if (concretePropertyTypes) {
|
|
69751
|
+
return getIntersectionType(concatenate(concretePropertyTypes, applicableIndexedMappedTypeSubstitions));
|
|
69766
69752
|
}
|
|
69767
|
-
|
|
69753
|
+
const types = concatenate(mapDefined(applicableIndexInfoCandidates, getTypeOfApplicableIndexInfoOfContextualType), applicableIndexedMappedTypeSubstitions);
|
|
69754
|
+
if (types.length > 0) {
|
|
69755
|
+
return getIntersectionType(types);
|
|
69756
|
+
}
|
|
69757
|
+
return void 0;
|
|
69768
69758
|
}
|
|
69769
|
-
return
|
|
69759
|
+
return isGenericMappedType(t) && !t.declaration.nameType ? getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) : getTypeOfConcretePropertyOfContextualType(t) || getTypeOfApplicableIndexInfoOfContextualType(t);
|
|
69770
69760
|
},
|
|
69771
69761
|
/*noReductions*/
|
|
69772
69762
|
true
|
|
69773
69763
|
);
|
|
69764
|
+
function getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) {
|
|
69765
|
+
const constraint = getConstraintTypeFromMappedType(t);
|
|
69766
|
+
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
69767
|
+
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
69768
|
+
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
69769
|
+
return substituteIndexedMappedType(t, propertyNameType);
|
|
69770
|
+
}
|
|
69771
|
+
return void 0;
|
|
69772
|
+
}
|
|
69773
|
+
function getTypeOfConcretePropertyOfContextualType(t) {
|
|
69774
|
+
const prop = getPropertyOfType(t, name);
|
|
69775
|
+
if (prop) {
|
|
69776
|
+
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
69777
|
+
}
|
|
69778
|
+
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
69779
|
+
const restType = getElementTypeOfSliceOfTupleType(
|
|
69780
|
+
t,
|
|
69781
|
+
t.target.fixedLength,
|
|
69782
|
+
/*endSkipCount*/
|
|
69783
|
+
0,
|
|
69784
|
+
/*writing*/
|
|
69785
|
+
false,
|
|
69786
|
+
/*noReductions*/
|
|
69787
|
+
true
|
|
69788
|
+
);
|
|
69789
|
+
if (restType) {
|
|
69790
|
+
return restType;
|
|
69791
|
+
}
|
|
69792
|
+
}
|
|
69793
|
+
return void 0;
|
|
69794
|
+
}
|
|
69795
|
+
function getTypeOfApplicableIndexInfoOfContextualType(t) {
|
|
69796
|
+
var _a;
|
|
69797
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
69798
|
+
}
|
|
69774
69799
|
}
|
|
69775
69800
|
function getContextualTypeForObjectLiteralMethod(node, contextFlags) {
|
|
69776
69801
|
Debug.assert(isObjectLiteralMethod(node));
|
package/lib/typescript.js
CHANGED
|
@@ -62277,7 +62277,6 @@ ${lanes.join("\n")}
|
|
|
62277
62277
|
let overrideNextErrorInfo = 0;
|
|
62278
62278
|
let lastSkippedInfo;
|
|
62279
62279
|
let incompatibleStack;
|
|
62280
|
-
let skipParentCounter = 0;
|
|
62281
62280
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
62282
62281
|
const result = isRelatedTo(
|
|
62283
62282
|
source,
|
|
@@ -62453,15 +62452,7 @@ ${lanes.join("\n")}
|
|
|
62453
62452
|
reportIncompatibleStack();
|
|
62454
62453
|
if (message.elidedInCompatabilityPyramid)
|
|
62455
62454
|
return;
|
|
62456
|
-
|
|
62457
|
-
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
62458
|
-
} else {
|
|
62459
|
-
skipParentCounter--;
|
|
62460
|
-
}
|
|
62461
|
-
}
|
|
62462
|
-
function reportParentSkippedError(message, ...args) {
|
|
62463
|
-
reportError(message, ...args);
|
|
62464
|
-
skipParentCounter++;
|
|
62455
|
+
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
62465
62456
|
}
|
|
62466
62457
|
function associateRelatedInfo(info) {
|
|
62467
62458
|
Debug.assert(!!errorInfo);
|
|
@@ -62798,14 +62789,14 @@ ${lanes.join("\n")}
|
|
|
62798
62789
|
}
|
|
62799
62790
|
}
|
|
62800
62791
|
if (suggestion !== void 0) {
|
|
62801
|
-
|
|
62792
|
+
reportError(
|
|
62802
62793
|
Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
|
|
62803
62794
|
symbolToString(prop),
|
|
62804
62795
|
typeToString(errorTarget),
|
|
62805
62796
|
suggestion
|
|
62806
62797
|
);
|
|
62807
62798
|
} else {
|
|
62808
|
-
|
|
62799
|
+
reportError(
|
|
62809
62800
|
Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
|
|
62810
62801
|
symbolToString(prop),
|
|
62811
62802
|
typeToString(errorTarget)
|
|
@@ -69736,41 +69727,75 @@ ${lanes.join("\n")}
|
|
|
69736
69727
|
return mapType(
|
|
69737
69728
|
type,
|
|
69738
69729
|
(t) => {
|
|
69739
|
-
|
|
69740
|
-
|
|
69741
|
-
|
|
69742
|
-
|
|
69743
|
-
const
|
|
69744
|
-
|
|
69745
|
-
|
|
69746
|
-
|
|
69747
|
-
|
|
69748
|
-
|
|
69749
|
-
|
|
69750
|
-
|
|
69751
|
-
}
|
|
69752
|
-
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
69753
|
-
const restType = getElementTypeOfSliceOfTupleType(
|
|
69754
|
-
t,
|
|
69755
|
-
t.target.fixedLength,
|
|
69756
|
-
/*endSkipCount*/
|
|
69757
|
-
0,
|
|
69758
|
-
/*writing*/
|
|
69759
|
-
false,
|
|
69760
|
-
/*noReductions*/
|
|
69761
|
-
true
|
|
69762
|
-
);
|
|
69763
|
-
if (restType) {
|
|
69764
|
-
return restType;
|
|
69730
|
+
if (!(t.flags & 3670016 /* StructuredType */)) {
|
|
69731
|
+
return void 0;
|
|
69732
|
+
}
|
|
69733
|
+
if (t.flags & 2097152 /* Intersection */) {
|
|
69734
|
+
const intersection = t;
|
|
69735
|
+
let applicableIndexedMappedTypeSubstitions;
|
|
69736
|
+
let concretePropertyTypes;
|
|
69737
|
+
let applicableIndexInfoCandidates;
|
|
69738
|
+
for (const t2 of intersection.types) {
|
|
69739
|
+
if (isGenericMappedType(t2) && !t2.declaration.nameType) {
|
|
69740
|
+
applicableIndexedMappedTypeSubstitions = append(applicableIndexedMappedTypeSubstitions, getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t2));
|
|
69741
|
+
continue;
|
|
69765
69742
|
}
|
|
69743
|
+
const typeOfConcreteProperty = getTypeOfConcretePropertyOfContextualType(t2);
|
|
69744
|
+
if (typeOfConcreteProperty) {
|
|
69745
|
+
concretePropertyTypes = append(concretePropertyTypes, typeOfConcreteProperty);
|
|
69746
|
+
continue;
|
|
69747
|
+
}
|
|
69748
|
+
applicableIndexInfoCandidates = append(applicableIndexInfoCandidates, t2);
|
|
69749
|
+
}
|
|
69750
|
+
if (concretePropertyTypes) {
|
|
69751
|
+
return getIntersectionType(concatenate(concretePropertyTypes, applicableIndexedMappedTypeSubstitions));
|
|
69766
69752
|
}
|
|
69767
|
-
|
|
69753
|
+
const types = concatenate(mapDefined(applicableIndexInfoCandidates, getTypeOfApplicableIndexInfoOfContextualType), applicableIndexedMappedTypeSubstitions);
|
|
69754
|
+
if (types.length > 0) {
|
|
69755
|
+
return getIntersectionType(types);
|
|
69756
|
+
}
|
|
69757
|
+
return void 0;
|
|
69768
69758
|
}
|
|
69769
|
-
return
|
|
69759
|
+
return isGenericMappedType(t) && !t.declaration.nameType ? getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) : getTypeOfConcretePropertyOfContextualType(t) || getTypeOfApplicableIndexInfoOfContextualType(t);
|
|
69770
69760
|
},
|
|
69771
69761
|
/*noReductions*/
|
|
69772
69762
|
true
|
|
69773
69763
|
);
|
|
69764
|
+
function getTypeOfApplicableIndexedMappedTypeSubstitutionOfContextualType(t) {
|
|
69765
|
+
const constraint = getConstraintTypeFromMappedType(t);
|
|
69766
|
+
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
69767
|
+
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
69768
|
+
if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
|
|
69769
|
+
return substituteIndexedMappedType(t, propertyNameType);
|
|
69770
|
+
}
|
|
69771
|
+
return void 0;
|
|
69772
|
+
}
|
|
69773
|
+
function getTypeOfConcretePropertyOfContextualType(t) {
|
|
69774
|
+
const prop = getPropertyOfType(t, name);
|
|
69775
|
+
if (prop) {
|
|
69776
|
+
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
69777
|
+
}
|
|
69778
|
+
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
69779
|
+
const restType = getElementTypeOfSliceOfTupleType(
|
|
69780
|
+
t,
|
|
69781
|
+
t.target.fixedLength,
|
|
69782
|
+
/*endSkipCount*/
|
|
69783
|
+
0,
|
|
69784
|
+
/*writing*/
|
|
69785
|
+
false,
|
|
69786
|
+
/*noReductions*/
|
|
69787
|
+
true
|
|
69788
|
+
);
|
|
69789
|
+
if (restType) {
|
|
69790
|
+
return restType;
|
|
69791
|
+
}
|
|
69792
|
+
}
|
|
69793
|
+
return void 0;
|
|
69794
|
+
}
|
|
69795
|
+
function getTypeOfApplicableIndexInfoOfContextualType(t) {
|
|
69796
|
+
var _a;
|
|
69797
|
+
return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(unescapeLeadingUnderscores(name)))) == null ? void 0 : _a.type;
|
|
69798
|
+
}
|
|
69774
69799
|
}
|
|
69775
69800
|
function getContextualTypeForObjectLiteralMethod(node, contextFlags) {
|
|
69776
69801
|
Debug.assert(isObjectLiteralMethod(node));
|
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.2.0-pr-
|
|
5
|
+
"version": "5.2.0-pr-52095-19",
|
|
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": "4c71532aed3e7c13c47ac849a5161e466ec26773"
|
|
118
118
|
}
|