@typescript-deploys/pr-build 5.5.0-pr-58610-9 → 5.5.0-pr-58243-90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es2015.generator.d.ts +1 -1
- package/lib/lib.es2015.iterable.d.ts +69 -67
- package/lib/lib.es2018.asyncgenerator.d.ts +1 -1
- package/lib/lib.es2018.asynciterable.d.ts +5 -5
- package/lib/lib.es2020.bigint.d.ts +8 -8
- package/lib/lib.es2020.string.d.ts +1 -1
- package/lib/lib.es2020.symbol.wellknown.d.ts +1 -1
- package/lib/lib.es2022.intl.d.ts +1 -1
- package/lib/tsc.js +112 -101
- package/lib/typescript.d.ts +30 -0
- package/lib/typescript.js +360 -104
- package/package.json +3 -1
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.20240523`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7338,6 +7338,7 @@ var Diagnostics = {
|
|
|
7338
7338
|
Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3 /* Message */, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."),
|
|
7339
7339
|
Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
|
|
7340
7340
|
Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3 /* Message */, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
|
|
7341
|
+
Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any: diag(6720, 3 /* Message */, "Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720", "Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),
|
|
7341
7342
|
Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
|
|
7342
7343
|
Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
|
|
7343
7344
|
Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported: diag(6805, 3 /* Message */, "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805", "Disable full type checking (only critical parse and emit errors will be reported)."),
|
|
@@ -7511,6 +7512,7 @@ var Diagnostics = {
|
|
|
7511
7512
|
Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it: diag(9036, 1 /* Error */, "Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it_9036", "Move the expression in default export to a variable and add a type annotation to it."),
|
|
7512
7513
|
Default_exports_can_t_be_inferred_with_isolatedDeclarations: diag(9037, 1 /* Error */, "Default_exports_can_t_be_inferred_with_isolatedDeclarations_9037", "Default exports can't be inferred with --isolatedDeclarations."),
|
|
7513
7514
|
Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations: diag(9038, 1 /* Error */, "Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations_9038", "Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."),
|
|
7515
|
+
Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations: diag(9039, 1 /* Error */, "Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations_9039", "Type containing private name '{0}' can't be used with --isolatedDeclarations."),
|
|
7514
7516
|
JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
|
|
7515
7517
|
JSX_elements_cannot_have_multiple_attributes_with_the_same_name: diag(17001, 1 /* Error */, "JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001", "JSX elements cannot have multiple attributes with the same name."),
|
|
7516
7518
|
Expected_corresponding_JSX_closing_tag_for_0: diag(17002, 1 /* Error */, "Expected_corresponding_JSX_closing_tag_for_0_17002", "Expected corresponding JSX closing tag for '{0}'."),
|
|
@@ -17612,6 +17614,12 @@ var computedOptions = createComputedCompilerOptions({
|
|
|
17612
17614
|
return getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
|
|
17613
17615
|
}
|
|
17614
17616
|
},
|
|
17617
|
+
strictBuiltinIteratorReturn: {
|
|
17618
|
+
dependencies: ["strict"],
|
|
17619
|
+
computeValue: (compilerOptions) => {
|
|
17620
|
+
return getStrictOptionValue(compilerOptions, "strictBuiltinIteratorReturn");
|
|
17621
|
+
}
|
|
17622
|
+
},
|
|
17615
17623
|
alwaysStrict: {
|
|
17616
17624
|
dependencies: ["strict"],
|
|
17617
17625
|
computeValue: (compilerOptions) => {
|
|
@@ -36005,6 +36013,16 @@ var commandOptionsWithoutBuild = [
|
|
|
36005
36013
|
description: Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
|
|
36006
36014
|
defaultValueDescription: Diagnostics.false_unless_strict_is_set
|
|
36007
36015
|
},
|
|
36016
|
+
{
|
|
36017
|
+
name: "strictBuiltinIteratorReturn",
|
|
36018
|
+
type: "boolean",
|
|
36019
|
+
affectsSemanticDiagnostics: true,
|
|
36020
|
+
affectsBuildInfo: true,
|
|
36021
|
+
strictFlag: true,
|
|
36022
|
+
category: Diagnostics.Type_Checking,
|
|
36023
|
+
description: Diagnostics.Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any,
|
|
36024
|
+
defaultValueDescription: Diagnostics.false_unless_strict_is_set
|
|
36025
|
+
},
|
|
36008
36026
|
{
|
|
36009
36027
|
name: "noImplicitThis",
|
|
36010
36028
|
type: "boolean",
|
|
@@ -45046,6 +45064,7 @@ function createTypeChecker(host) {
|
|
|
45046
45064
|
var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
45047
45065
|
var strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply");
|
|
45048
45066
|
var strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
|
|
45067
|
+
var strictBuiltinIteratorReturn = getStrictOptionValue(compilerOptions, "strictBuiltinIteratorReturn");
|
|
45049
45068
|
var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
|
|
45050
45069
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
45051
45070
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
@@ -45382,13 +45401,13 @@ function createTypeChecker(host) {
|
|
|
45382
45401
|
/*reportErrors*/
|
|
45383
45402
|
false
|
|
45384
45403
|
),
|
|
45385
|
-
|
|
45404
|
+
getAnyAsyncIterableType: () => {
|
|
45386
45405
|
const type = getGlobalAsyncIterableType(
|
|
45387
45406
|
/*reportErrors*/
|
|
45388
45407
|
false
|
|
45389
45408
|
);
|
|
45390
45409
|
if (type === emptyGenericType) return void 0;
|
|
45391
|
-
return type;
|
|
45410
|
+
return createTypeReference(type, [anyType, anyType, anyType]);
|
|
45392
45411
|
},
|
|
45393
45412
|
isSymbolAccessible,
|
|
45394
45413
|
isArrayType,
|
|
@@ -45860,8 +45879,6 @@ function createTypeChecker(host) {
|
|
|
45860
45879
|
}
|
|
45861
45880
|
};
|
|
45862
45881
|
var anyIterationTypes = createIterationTypes(anyType, anyType, anyType);
|
|
45863
|
-
var anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType);
|
|
45864
|
-
var defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType);
|
|
45865
45882
|
var asyncIterationTypesResolver = {
|
|
45866
45883
|
iterableCacheKey: "iterationTypesOfAsyncIterable",
|
|
45867
45884
|
iteratorCacheKey: "iterationTypesOfAsyncIterator",
|
|
@@ -49230,6 +49247,7 @@ function createTypeChecker(host) {
|
|
|
49230
49247
|
return result;
|
|
49231
49248
|
}
|
|
49232
49249
|
}
|
|
49250
|
+
context.tracker.reportInferenceFallback(existing);
|
|
49233
49251
|
return void 0;
|
|
49234
49252
|
}
|
|
49235
49253
|
function symbolToNode(symbol, context, meaning) {
|
|
@@ -49923,7 +49941,37 @@ function createTypeChecker(host) {
|
|
|
49923
49941
|
}
|
|
49924
49942
|
let typeArgumentNodes;
|
|
49925
49943
|
if (typeArguments.length > 0) {
|
|
49926
|
-
|
|
49944
|
+
let typeParameterCount;
|
|
49945
|
+
if (type2.target.typeParameters) {
|
|
49946
|
+
typeParameterCount = Math.min(type2.target.typeParameters.length, typeArguments.length);
|
|
49947
|
+
if (isReferenceToType(type2, getGlobalIterableType(
|
|
49948
|
+
/*reportErrors*/
|
|
49949
|
+
false
|
|
49950
|
+
)) || isReferenceToType(type2, getGlobalIterableIteratorType(
|
|
49951
|
+
/*reportErrors*/
|
|
49952
|
+
false
|
|
49953
|
+
)) || isReferenceToType(type2, getGlobalAsyncIterableType(
|
|
49954
|
+
/*reportErrors*/
|
|
49955
|
+
false
|
|
49956
|
+
)) || isReferenceToType(type2, getGlobalAsyncIterableIteratorType(
|
|
49957
|
+
/*reportErrors*/
|
|
49958
|
+
false
|
|
49959
|
+
))) {
|
|
49960
|
+
if (!type2.node || !isTypeReferenceNode(type2.node) || !type2.node.typeArguments || type2.node.typeArguments.length < typeParameterCount) {
|
|
49961
|
+
while (typeParameterCount > 0) {
|
|
49962
|
+
const typeArgument = typeArguments[typeParameterCount - 1];
|
|
49963
|
+
const typeParameter = type2.target.typeParameters[typeParameterCount - 1];
|
|
49964
|
+
const defaultType = getDefaultFromTypeParameter(typeParameter);
|
|
49965
|
+
if (!defaultType || !isTypeIdenticalTo(typeArgument, defaultType)) {
|
|
49966
|
+
break;
|
|
49967
|
+
}
|
|
49968
|
+
typeParameterCount--;
|
|
49969
|
+
}
|
|
49970
|
+
}
|
|
49971
|
+
}
|
|
49972
|
+
} else {
|
|
49973
|
+
typeParameterCount = 0;
|
|
49974
|
+
}
|
|
49927
49975
|
typeArgumentNodes = mapToTypeNodes(typeArguments.slice(i, typeParameterCount), context);
|
|
49928
49976
|
}
|
|
49929
49977
|
const flags = context.flags;
|
|
@@ -51265,6 +51313,9 @@ function createTypeChecker(host) {
|
|
|
51265
51313
|
symAtLocation === void 0 && sym !== void 0 || // If the symbol is found both in declaration scope and in current scope then it shoudl point to the same reference
|
|
51266
51314
|
symAtLocation && sym && !getSymbolIfSameReference(getExportSymbolOfValueSymbolIfExported(symAtLocation), sym)
|
|
51267
51315
|
) {
|
|
51316
|
+
if (symAtLocation !== unknownSymbol) {
|
|
51317
|
+
context.tracker.reportInferenceFallback(node);
|
|
51318
|
+
}
|
|
51268
51319
|
introducesError = true;
|
|
51269
51320
|
return { introducesError, node, sym };
|
|
51270
51321
|
}
|
|
@@ -51283,6 +51334,7 @@ function createTypeChecker(host) {
|
|
|
51283
51334
|
/*shouldComputeAliasesToMakeVisible*/
|
|
51284
51335
|
false
|
|
51285
51336
|
).accessibility !== 0 /* Accessible */) {
|
|
51337
|
+
context.tracker.reportInferenceFallback(node);
|
|
51286
51338
|
introducesError = true;
|
|
51287
51339
|
} else {
|
|
51288
51340
|
context.tracker.trackSymbol(sym, context.enclosingDeclaration, meaning);
|
|
@@ -55099,6 +55151,9 @@ function createTypeChecker(host) {
|
|
|
55099
55151
|
links.instantiations = /* @__PURE__ */ new Map();
|
|
55100
55152
|
links.instantiations.set(getTypeListId(typeParameters), type);
|
|
55101
55153
|
}
|
|
55154
|
+
if (type === intrinsicMarkerType && symbol.escapedName === "BuiltinIteratorReturn") {
|
|
55155
|
+
type = strictBuiltinIteratorReturn ? voidType : anyType;
|
|
55156
|
+
}
|
|
55102
55157
|
} else {
|
|
55103
55158
|
type = errorType;
|
|
55104
55159
|
if (declaration.kind === 340 /* JSDocEnumTag */) {
|
|
@@ -58357,7 +58412,7 @@ function createTypeChecker(host) {
|
|
|
58357
58412
|
return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType(
|
|
58358
58413
|
"AsyncIterable",
|
|
58359
58414
|
/*arity*/
|
|
58360
|
-
|
|
58415
|
+
3,
|
|
58361
58416
|
reportErrors2
|
|
58362
58417
|
)) || emptyGenericType;
|
|
58363
58418
|
}
|
|
@@ -58373,7 +58428,7 @@ function createTypeChecker(host) {
|
|
|
58373
58428
|
return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType(
|
|
58374
58429
|
"AsyncIterableIterator",
|
|
58375
58430
|
/*arity*/
|
|
58376
|
-
|
|
58431
|
+
3,
|
|
58377
58432
|
reportErrors2
|
|
58378
58433
|
)) || emptyGenericType;
|
|
58379
58434
|
}
|
|
@@ -58389,7 +58444,7 @@ function createTypeChecker(host) {
|
|
|
58389
58444
|
return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType(
|
|
58390
58445
|
"Iterable",
|
|
58391
58446
|
/*arity*/
|
|
58392
|
-
|
|
58447
|
+
3,
|
|
58393
58448
|
reportErrors2
|
|
58394
58449
|
)) || emptyGenericType;
|
|
58395
58450
|
}
|
|
@@ -58405,7 +58460,7 @@ function createTypeChecker(host) {
|
|
|
58405
58460
|
return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType(
|
|
58406
58461
|
"IterableIterator",
|
|
58407
58462
|
/*arity*/
|
|
58408
|
-
|
|
58463
|
+
3,
|
|
58409
58464
|
reportErrors2
|
|
58410
58465
|
)) || emptyGenericType;
|
|
58411
58466
|
}
|
|
@@ -58587,7 +58642,7 @@ function createTypeChecker(host) {
|
|
|
58587
58642
|
return createTypeFromGenericGlobalType(getGlobalIterableType(
|
|
58588
58643
|
/*reportErrors*/
|
|
58589
58644
|
true
|
|
58590
|
-
), [iteratedType]);
|
|
58645
|
+
), [iteratedType, voidType, undefinedType]);
|
|
58591
58646
|
}
|
|
58592
58647
|
function createArrayType(elementType, readonly) {
|
|
58593
58648
|
return createTypeFromGenericGlobalType(readonly ? globalReadonlyArrayType : globalArrayType, [elementType]);
|
|
@@ -75981,24 +76036,14 @@ function createTypeChecker(host) {
|
|
|
75981
76036
|
void 0
|
|
75982
76037
|
) || unknownType;
|
|
75983
76038
|
if (globalGeneratorType === emptyGenericType) {
|
|
75984
|
-
const
|
|
76039
|
+
const globalIterableIteratorType = resolver.getGlobalIterableIteratorType(
|
|
75985
76040
|
/*reportErrors*/
|
|
75986
76041
|
false
|
|
75987
76042
|
);
|
|
75988
|
-
|
|
75989
|
-
|
|
75990
|
-
const iterableIteratorNextType = iterationTypes ? iterationTypes.nextType : undefinedType;
|
|
75991
|
-
if (isTypeAssignableTo(returnType, iterableIteratorReturnType) && isTypeAssignableTo(iterableIteratorNextType, nextType)) {
|
|
75992
|
-
if (globalType !== emptyGenericType) {
|
|
75993
|
-
return createTypeFromGenericGlobalType(globalType, [yieldType]);
|
|
75994
|
-
}
|
|
75995
|
-
resolver.getGlobalIterableIteratorType(
|
|
75996
|
-
/*reportErrors*/
|
|
75997
|
-
true
|
|
75998
|
-
);
|
|
75999
|
-
return emptyObjectType;
|
|
76043
|
+
if (globalIterableIteratorType !== emptyGenericType) {
|
|
76044
|
+
return createTypeFromGenericGlobalType(globalIterableIteratorType, [yieldType, returnType, nextType]);
|
|
76000
76045
|
}
|
|
76001
|
-
resolver.
|
|
76046
|
+
resolver.getGlobalIterableIteratorType(
|
|
76002
76047
|
/*reportErrors*/
|
|
76003
76048
|
true
|
|
76004
76049
|
);
|
|
@@ -81025,41 +81070,14 @@ function createTypeChecker(host) {
|
|
|
81025
81070
|
function getIterationTypesOfIterableCached(type, resolver) {
|
|
81026
81071
|
return getCachedIterationTypes(type, resolver.iterableCacheKey);
|
|
81027
81072
|
}
|
|
81028
|
-
function getIterationTypesOfGlobalIterableType(globalType, resolver) {
|
|
81029
|
-
const globalIterationTypes = getIterationTypesOfIterableCached(globalType, resolver) || getIterationTypesOfIterableSlow(
|
|
81030
|
-
globalType,
|
|
81031
|
-
resolver,
|
|
81032
|
-
/*errorNode*/
|
|
81033
|
-
void 0,
|
|
81034
|
-
/*errorOutputContainer*/
|
|
81035
|
-
void 0,
|
|
81036
|
-
/*noCache*/
|
|
81037
|
-
false
|
|
81038
|
-
);
|
|
81039
|
-
return globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes;
|
|
81040
|
-
}
|
|
81041
81073
|
function getIterationTypesOfIterableFast(type, resolver) {
|
|
81042
|
-
|
|
81043
|
-
if (isReferenceToType(type, globalType = resolver.getGlobalIterableType(
|
|
81074
|
+
if (isReferenceToType(type, resolver.getGlobalIterableType(
|
|
81044
81075
|
/*reportErrors*/
|
|
81045
81076
|
false
|
|
81046
|
-
)) || isReferenceToType(type,
|
|
81077
|
+
)) || isReferenceToType(type, resolver.getGlobalIterableIteratorType(
|
|
81047
81078
|
/*reportErrors*/
|
|
81048
81079
|
false
|
|
81049
|
-
))
|
|
81050
|
-
const [yieldType] = getTypeArguments(type);
|
|
81051
|
-
const { returnType, nextType } = getIterationTypesOfGlobalIterableType(globalType, resolver);
|
|
81052
|
-
return setCachedIterationTypes(type, resolver.iterableCacheKey, createIterationTypes(resolver.resolveIterationType(
|
|
81053
|
-
yieldType,
|
|
81054
|
-
/*errorNode*/
|
|
81055
|
-
void 0
|
|
81056
|
-
) || yieldType, resolver.resolveIterationType(
|
|
81057
|
-
returnType,
|
|
81058
|
-
/*errorNode*/
|
|
81059
|
-
void 0
|
|
81060
|
-
) || returnType, nextType));
|
|
81061
|
-
}
|
|
81062
|
-
if (isReferenceToType(type, resolver.getGlobalGeneratorType(
|
|
81080
|
+
)) || isReferenceToType(type, resolver.getGlobalGeneratorType(
|
|
81063
81081
|
/*reportErrors*/
|
|
81064
81082
|
false
|
|
81065
81083
|
))) {
|
|
@@ -81104,10 +81122,10 @@ function createTypeChecker(host) {
|
|
|
81104
81122
|
!!getAwaitedTypeOfPromise(type) || !allowAsyncIterables && isForOfStatement(errorNode.parent) && errorNode.parent.expression === errorNode && getGlobalAsyncIterableType(
|
|
81105
81123
|
/*reportErrors*/
|
|
81106
81124
|
false
|
|
81107
|
-
) !== emptyGenericType && isTypeAssignableTo(type, getGlobalAsyncIterableType(
|
|
81125
|
+
) !== emptyGenericType && isTypeAssignableTo(type, createTypeFromGenericGlobalType(getGlobalAsyncIterableType(
|
|
81108
81126
|
/*reportErrors*/
|
|
81109
81127
|
false
|
|
81110
|
-
))
|
|
81128
|
+
), [anyType, anyType, anyType]))
|
|
81111
81129
|
);
|
|
81112
81130
|
return errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, typeToString(type));
|
|
81113
81131
|
}
|
|
@@ -81137,26 +81155,10 @@ function createTypeChecker(host) {
|
|
|
81137
81155
|
return getCachedIterationTypes(type, resolver.iteratorCacheKey);
|
|
81138
81156
|
}
|
|
81139
81157
|
function getIterationTypesOfIteratorFast(type, resolver) {
|
|
81140
|
-
|
|
81158
|
+
if (isReferenceToType(type, resolver.getGlobalIterableIteratorType(
|
|
81141
81159
|
/*reportErrors*/
|
|
81142
81160
|
false
|
|
81143
|
-
)
|
|
81144
|
-
if (isReferenceToType(type, globalType)) {
|
|
81145
|
-
const [yieldType] = getTypeArguments(type);
|
|
81146
|
-
const globalIterationTypes = getIterationTypesOfIteratorCached(globalType, resolver) || getIterationTypesOfIteratorSlow(
|
|
81147
|
-
globalType,
|
|
81148
|
-
resolver,
|
|
81149
|
-
/*errorNode*/
|
|
81150
|
-
void 0,
|
|
81151
|
-
/*errorOutputContainer*/
|
|
81152
|
-
void 0,
|
|
81153
|
-
/*noCache*/
|
|
81154
|
-
false
|
|
81155
|
-
);
|
|
81156
|
-
const { returnType, nextType } = globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes;
|
|
81157
|
-
return setCachedIterationTypes(type, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType));
|
|
81158
|
-
}
|
|
81159
|
-
if (isReferenceToType(type, resolver.getGlobalIteratorType(
|
|
81161
|
+
)) || isReferenceToType(type, resolver.getGlobalIteratorType(
|
|
81160
81162
|
/*reportErrors*/
|
|
81161
81163
|
false
|
|
81162
81164
|
)) || isReferenceToType(type, resolver.getGlobalGeneratorType(
|
|
@@ -81233,7 +81235,7 @@ function createTypeChecker(host) {
|
|
|
81233
81235
|
}
|
|
81234
81236
|
const methodType = method && !(methodName === "next" && method.flags & 16777216 /* Optional */) ? methodName === "next" ? getTypeOfSymbol(method) : getTypeWithFacts(getTypeOfSymbol(method), 2097152 /* NEUndefinedOrNull */) : void 0;
|
|
81235
81237
|
if (isTypeAny(methodType)) {
|
|
81236
|
-
return
|
|
81238
|
+
return anyIterationTypes;
|
|
81237
81239
|
}
|
|
81238
81240
|
const methodSignatures = methodType ? getSignaturesOfType(methodType, 0 /* Call */) : emptyArray;
|
|
81239
81241
|
if (methodSignatures.length === 0) {
|
|
@@ -82372,7 +82374,9 @@ function createTypeChecker(host) {
|
|
|
82372
82374
|
checkExportsOnMergedDeclarations(node);
|
|
82373
82375
|
checkTypeParameters(node.typeParameters);
|
|
82374
82376
|
if (node.type.kind === 141 /* IntrinsicKeyword */) {
|
|
82375
|
-
|
|
82377
|
+
const typeParameterCount = length(node.typeParameters);
|
|
82378
|
+
const valid = typeParameterCount === 0 ? node.name.escapedText === "BuiltinIteratorReturn" : typeParameterCount === 1 && intrinsicTypeKinds.has(node.name.escapedText);
|
|
82379
|
+
if (!valid) {
|
|
82376
82380
|
error(node.type, Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types);
|
|
82377
82381
|
}
|
|
82378
82382
|
} else {
|
|
@@ -84845,6 +84849,7 @@ function createTypeChecker(host) {
|
|
|
84845
84849
|
function getSingleReturnExpression(declaration) {
|
|
84846
84850
|
let candidateExpr;
|
|
84847
84851
|
if (declaration && !nodeIsMissing(declaration.body)) {
|
|
84852
|
+
if (getFunctionFlags(declaration) & 3 /* AsyncGenerator */) return void 0;
|
|
84848
84853
|
const body = declaration.body;
|
|
84849
84854
|
if (body && isBlock(body)) {
|
|
84850
84855
|
forEachReturnStatement(body, (s) => {
|
|
@@ -110029,6 +110034,9 @@ function createGetIsolatedDeclarationErrors(resolver) {
|
|
|
110029
110034
|
if (heritageClause) {
|
|
110030
110035
|
return createDiagnosticForNode(node, Diagnostics.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations);
|
|
110031
110036
|
}
|
|
110037
|
+
if ((isPartOfTypeNode(node) || isTypeQueryNode(node.parent)) && (isEntityName(node) || isEntityNameExpression(node))) {
|
|
110038
|
+
return createEntityInTypeNodeError(node);
|
|
110039
|
+
}
|
|
110032
110040
|
Debug.type(node);
|
|
110033
110041
|
switch (node.kind) {
|
|
110034
110042
|
case 177 /* GetAccessor */:
|
|
@@ -110064,8 +110072,13 @@ function createGetIsolatedDeclarationErrors(resolver) {
|
|
|
110064
110072
|
}
|
|
110065
110073
|
}
|
|
110066
110074
|
function findNearestDeclaration(node) {
|
|
110067
|
-
const result = findAncestor(node, (n) => isExportAssignment(n) ||
|
|
110068
|
-
return
|
|
110075
|
+
const result = findAncestor(node, (n) => isExportAssignment(n) || isStatement(n) || isVariableDeclaration(n) || isPropertyDeclaration(n) || isParameter(n));
|
|
110076
|
+
if (!result) return void 0;
|
|
110077
|
+
if (isExportAssignment(result)) return result;
|
|
110078
|
+
if (isReturnStatement(result)) {
|
|
110079
|
+
return findAncestor(result, (n) => isFunctionLikeDeclaration(n) && !isConstructorDeclaration(n));
|
|
110080
|
+
}
|
|
110081
|
+
return isStatement(result) ? void 0 : result;
|
|
110069
110082
|
}
|
|
110070
110083
|
function createAccessorTypeError(node) {
|
|
110071
110084
|
const { getAccessor, setAccessor } = getAllAccessorDeclarations(node.symbol.declarations, node);
|
|
@@ -110079,11 +110092,10 @@ function createGetIsolatedDeclarationErrors(resolver) {
|
|
|
110079
110092
|
}
|
|
110080
110093
|
return diag2;
|
|
110081
110094
|
}
|
|
110082
|
-
function
|
|
110083
|
-
const diag2 = createDiagnosticForNode(node, errorByDeclarationKind[node.kind]);
|
|
110095
|
+
function addParentDeclarationRelatedInfo(node, diag2) {
|
|
110084
110096
|
const parentDeclaration = findNearestDeclaration(node);
|
|
110085
110097
|
if (parentDeclaration) {
|
|
110086
|
-
const targetStr = isExportAssignment(parentDeclaration) ? "" : getTextOfNode(
|
|
110098
|
+
const targetStr = isExportAssignment(parentDeclaration) || !parentDeclaration.name ? "" : getTextOfNode(
|
|
110087
110099
|
parentDeclaration.name,
|
|
110088
110100
|
/*includeTrivia*/
|
|
110089
110101
|
false
|
|
@@ -110092,30 +110104,19 @@ function createGetIsolatedDeclarationErrors(resolver) {
|
|
|
110092
110104
|
}
|
|
110093
110105
|
return diag2;
|
|
110094
110106
|
}
|
|
110107
|
+
function createObjectLiteralError(node) {
|
|
110108
|
+
const diag2 = createDiagnosticForNode(node, errorByDeclarationKind[node.kind]);
|
|
110109
|
+
addParentDeclarationRelatedInfo(node, diag2);
|
|
110110
|
+
return diag2;
|
|
110111
|
+
}
|
|
110095
110112
|
function createArrayLiteralError(node) {
|
|
110096
110113
|
const diag2 = createDiagnosticForNode(node, errorByDeclarationKind[node.kind]);
|
|
110097
|
-
|
|
110098
|
-
if (parentDeclaration) {
|
|
110099
|
-
const targetStr = isExportAssignment(parentDeclaration) ? "" : getTextOfNode(
|
|
110100
|
-
parentDeclaration.name,
|
|
110101
|
-
/*includeTrivia*/
|
|
110102
|
-
false
|
|
110103
|
-
);
|
|
110104
|
-
addRelatedInfo(diag2, createDiagnosticForNode(parentDeclaration, relatedSuggestionByDeclarationKind[parentDeclaration.kind], targetStr));
|
|
110105
|
-
}
|
|
110114
|
+
addParentDeclarationRelatedInfo(node, diag2);
|
|
110106
110115
|
return diag2;
|
|
110107
110116
|
}
|
|
110108
110117
|
function createReturnTypeError(node) {
|
|
110109
110118
|
const diag2 = createDiagnosticForNode(node, errorByDeclarationKind[node.kind]);
|
|
110110
|
-
|
|
110111
|
-
if (parentDeclaration) {
|
|
110112
|
-
const targetStr = isExportAssignment(parentDeclaration) ? "" : getTextOfNode(
|
|
110113
|
-
parentDeclaration.name,
|
|
110114
|
-
/*includeTrivia*/
|
|
110115
|
-
false
|
|
110116
|
-
);
|
|
110117
|
-
addRelatedInfo(diag2, createDiagnosticForNode(parentDeclaration, relatedSuggestionByDeclarationKind[parentDeclaration.kind], targetStr));
|
|
110118
|
-
}
|
|
110119
|
+
addParentDeclarationRelatedInfo(node, diag2);
|
|
110119
110120
|
addRelatedInfo(diag2, createDiagnosticForNode(node, relatedSuggestionByDeclarationKind[node.kind]));
|
|
110120
110121
|
return diag2;
|
|
110121
110122
|
}
|
|
@@ -110153,11 +110154,20 @@ function createGetIsolatedDeclarationErrors(resolver) {
|
|
|
110153
110154
|
function createClassExpressionError(node) {
|
|
110154
110155
|
return createExpressionError(node, Diagnostics.Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations);
|
|
110155
110156
|
}
|
|
110157
|
+
function createEntityInTypeNodeError(node) {
|
|
110158
|
+
const diag2 = createDiagnosticForNode(node, Diagnostics.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations, getTextOfNode(
|
|
110159
|
+
node,
|
|
110160
|
+
/*includeTrivia*/
|
|
110161
|
+
false
|
|
110162
|
+
));
|
|
110163
|
+
addParentDeclarationRelatedInfo(node, diag2);
|
|
110164
|
+
return diag2;
|
|
110165
|
+
}
|
|
110156
110166
|
function createExpressionError(node, diagnosticMessage) {
|
|
110157
110167
|
const parentDeclaration = findNearestDeclaration(node);
|
|
110158
110168
|
let diag2;
|
|
110159
110169
|
if (parentDeclaration) {
|
|
110160
|
-
const targetStr = isExportAssignment(parentDeclaration) ? "" : getTextOfNode(
|
|
110170
|
+
const targetStr = isExportAssignment(parentDeclaration) || !parentDeclaration.name ? "" : getTextOfNode(
|
|
110161
110171
|
parentDeclaration.name,
|
|
110162
110172
|
/*includeTrivia*/
|
|
110163
110173
|
false
|
|
@@ -129193,6 +129203,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
|
|
|
129193
129203
|
function typeFromSingleReturnExpression(declaration, context) {
|
|
129194
129204
|
let candidateExpr;
|
|
129195
129205
|
if (declaration && !nodeIsMissing(declaration.body)) {
|
|
129206
|
+
if (getFunctionFlags(declaration) & 3 /* AsyncGenerator */) return void 0;
|
|
129196
129207
|
const body = declaration.body;
|
|
129197
129208
|
if (body && isBlock(body)) {
|
|
129198
129209
|
forEachReturnStatement(body, (s) => {
|
package/lib/typescript.d.ts
CHANGED
|
@@ -121,6 +121,7 @@ declare namespace ts {
|
|
|
121
121
|
ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls",
|
|
122
122
|
ProvideInlayHints = "provideInlayHints",
|
|
123
123
|
WatchChange = "watchChange",
|
|
124
|
+
MapCode = "mapCode",
|
|
124
125
|
}
|
|
125
126
|
/**
|
|
126
127
|
* A TypeScript Server message
|
|
@@ -1769,6 +1770,33 @@ declare namespace ts {
|
|
|
1769
1770
|
export interface InlayHintsResponse extends Response {
|
|
1770
1771
|
body?: InlayHintItem[];
|
|
1771
1772
|
}
|
|
1773
|
+
export interface MapCodeRequestArgs extends FileRequestArgs {
|
|
1774
|
+
/**
|
|
1775
|
+
* The files and changes to try and apply/map.
|
|
1776
|
+
*/
|
|
1777
|
+
mapping: MapCodeRequestDocumentMapping;
|
|
1778
|
+
}
|
|
1779
|
+
export interface MapCodeRequestDocumentMapping {
|
|
1780
|
+
/**
|
|
1781
|
+
* The specific code to map/insert/replace in the file.
|
|
1782
|
+
*/
|
|
1783
|
+
contents: string[];
|
|
1784
|
+
/**
|
|
1785
|
+
* Areas of "focus" to inform the code mapper with. For example, cursor
|
|
1786
|
+
* location, current selection, viewport, etc. Nested arrays denote
|
|
1787
|
+
* priority: toplevel arrays are more important than inner arrays, and
|
|
1788
|
+
* inner array priorities are based on items within that array. Items
|
|
1789
|
+
* earlier in the arrays have higher priority.
|
|
1790
|
+
*/
|
|
1791
|
+
focusLocations?: TextSpan[][];
|
|
1792
|
+
}
|
|
1793
|
+
export interface MapCodeRequest extends FileRequest {
|
|
1794
|
+
command: CommandTypes.MapCode;
|
|
1795
|
+
arguments: MapCodeRequestArgs;
|
|
1796
|
+
}
|
|
1797
|
+
export interface MapCodeResponse extends Response {
|
|
1798
|
+
body: readonly FileCodeEdits[];
|
|
1799
|
+
}
|
|
1772
1800
|
/**
|
|
1773
1801
|
* Synchronous request for semantic diagnostics of one file.
|
|
1774
1802
|
*/
|
|
@@ -3468,6 +3496,7 @@ declare namespace ts {
|
|
|
3468
3496
|
private getLinkedEditingRange;
|
|
3469
3497
|
private getDocumentHighlights;
|
|
3470
3498
|
private provideInlayHints;
|
|
3499
|
+
private mapCode;
|
|
3471
3500
|
private setCompilerOptionsForInferredProjects;
|
|
3472
3501
|
private getProjectInfo;
|
|
3473
3502
|
private getProjectInfoWorker;
|
|
@@ -6997,6 +7026,7 @@ declare namespace ts {
|
|
|
6997
7026
|
strictBindCallApply?: boolean;
|
|
6998
7027
|
strictNullChecks?: boolean;
|
|
6999
7028
|
strictPropertyInitialization?: boolean;
|
|
7029
|
+
strictBuiltinIteratorReturn?: boolean;
|
|
7000
7030
|
stripInternal?: boolean;
|
|
7001
7031
|
/** @deprecated */
|
|
7002
7032
|
suppressExcessPropertyErrors?: boolean;
|