typescript 5.1.0-dev.20230327 → 5.1.0-dev.20230329
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 +55 -28
- package/lib/tsserver.js +61 -35
- package/lib/tsserverlibrary.js +61 -35
- package/lib/typescript.js +61 -35
- package/lib/typingsInstaller.js +3 -2
- 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.1";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20230329`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7740,7 +7740,8 @@ var Diagnostics = {
|
|
|
7740
7740
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
7741
7741
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
7742
7742
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
7743
|
-
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.")
|
|
7743
|
+
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."),
|
|
7744
|
+
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}'")
|
|
7744
7745
|
};
|
|
7745
7746
|
|
|
7746
7747
|
// src/compiler/scanner.ts
|
|
@@ -49912,6 +49913,7 @@ function createTypeChecker(host) {
|
|
|
49912
49913
|
), 0 /* None */);
|
|
49913
49914
|
}
|
|
49914
49915
|
function serializeMaybeAliasAssignment(symbol) {
|
|
49916
|
+
var _a2;
|
|
49915
49917
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
49916
49918
|
return false;
|
|
49917
49919
|
}
|
|
@@ -49991,7 +49993,7 @@ function createTypeChecker(host) {
|
|
|
49991
49993
|
void 0,
|
|
49992
49994
|
serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
|
|
49993
49995
|
)
|
|
49994
|
-
], 2 /* Const */)
|
|
49996
|
+
], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 265 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
|
|
49995
49997
|
);
|
|
49996
49998
|
addResult(
|
|
49997
49999
|
statement,
|
|
@@ -50027,7 +50029,7 @@ function createTypeChecker(host) {
|
|
|
50027
50029
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
50028
50030
|
return [];
|
|
50029
50031
|
}
|
|
50030
|
-
if (p.flags & 4194304 /* Prototype */ || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
50032
|
+
if (p.flags & 4194304 /* Prototype */ || p.escapedName === "constructor" || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
50031
50033
|
return [];
|
|
50032
50034
|
}
|
|
50033
50035
|
const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0);
|
|
@@ -53527,6 +53529,9 @@ function createTypeChecker(host) {
|
|
|
53527
53529
|
return type.resolvedDefaultConstraint;
|
|
53528
53530
|
}
|
|
53529
53531
|
function getConstraintOfDistributiveConditionalType(type) {
|
|
53532
|
+
if (type.resolvedConstraintOfDistributive !== void 0) {
|
|
53533
|
+
return type.resolvedConstraintOfDistributive || void 0;
|
|
53534
|
+
}
|
|
53530
53535
|
if (type.root.isDistributive && type.restrictiveInstantiation !== type) {
|
|
53531
53536
|
const simplified = getSimplifiedType(
|
|
53532
53537
|
type.checkType,
|
|
@@ -53537,10 +53542,12 @@ function createTypeChecker(host) {
|
|
|
53537
53542
|
if (constraint && constraint !== type.checkType) {
|
|
53538
53543
|
const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
|
|
53539
53544
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
53545
|
+
type.resolvedConstraintOfDistributive = instantiated;
|
|
53540
53546
|
return instantiated;
|
|
53541
53547
|
}
|
|
53542
53548
|
}
|
|
53543
53549
|
}
|
|
53550
|
+
type.resolvedConstraintOfDistributive = false;
|
|
53544
53551
|
return void 0;
|
|
53545
53552
|
}
|
|
53546
53553
|
function getConstraintFromConditionalType(type) {
|
|
@@ -72228,7 +72235,7 @@ function createTypeChecker(host) {
|
|
|
72228
72235
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
72229
72236
|
const functionFlags = getFunctionFlags(func);
|
|
72230
72237
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
72231
|
-
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
72238
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */ | 2 /* Unknown */)) {
|
|
72232
72239
|
return;
|
|
72233
72240
|
}
|
|
72234
72241
|
if (func.kind === 171 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 239 /* Block */ || !functionHasImplicitReturn(func)) {
|
|
@@ -78200,8 +78207,9 @@ function createTypeChecker(host) {
|
|
|
78200
78207
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
78201
78208
|
}
|
|
78202
78209
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
78203
|
-
var _a2, _b, _c, _d;
|
|
78210
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
78204
78211
|
const baseProperties = getPropertiesOfType(baseType);
|
|
78212
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
78205
78213
|
basePropertyCheck:
|
|
78206
78214
|
for (const baseProperty of baseProperties) {
|
|
78207
78215
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -78227,20 +78235,34 @@ function createTypeChecker(host) {
|
|
|
78227
78235
|
continue basePropertyCheck;
|
|
78228
78236
|
}
|
|
78229
78237
|
}
|
|
78230
|
-
if (
|
|
78231
|
-
error(
|
|
78238
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
78239
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
78232
78240
|
derivedClassDecl,
|
|
78233
|
-
Diagnostics.
|
|
78234
|
-
|
|
78241
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
78242
|
+
typeToString(type),
|
|
78235
78243
|
typeToString(baseType)
|
|
78236
78244
|
);
|
|
78245
|
+
}
|
|
78246
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
78247
|
+
addRelatedInfo(
|
|
78248
|
+
inheritedAbstractMemberNotImplementedError,
|
|
78249
|
+
createDiagnosticForNode(
|
|
78250
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
78251
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
78252
|
+
symbolToString(baseProperty),
|
|
78253
|
+
typeToString(baseType)
|
|
78254
|
+
)
|
|
78255
|
+
);
|
|
78237
78256
|
} else {
|
|
78238
|
-
|
|
78239
|
-
|
|
78240
|
-
|
|
78241
|
-
|
|
78242
|
-
|
|
78243
|
-
|
|
78257
|
+
addRelatedInfo(
|
|
78258
|
+
inheritedAbstractMemberNotImplementedError,
|
|
78259
|
+
createDiagnosticForNode(
|
|
78260
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
78261
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
78262
|
+
typeToString(type),
|
|
78263
|
+
symbolToString(baseProperty),
|
|
78264
|
+
typeToString(baseType)
|
|
78265
|
+
)
|
|
78244
78266
|
);
|
|
78245
78267
|
}
|
|
78246
78268
|
}
|
|
@@ -78253,7 +78275,7 @@ function createTypeChecker(host) {
|
|
|
78253
78275
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
78254
78276
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
78255
78277
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
78256
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
78278
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
78257
78279
|
continue;
|
|
78258
78280
|
}
|
|
78259
78281
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -78262,8 +78284,8 @@ function createTypeChecker(host) {
|
|
|
78262
78284
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
78263
78285
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
78264
78286
|
} else if (useDefineForClassFields) {
|
|
78265
|
-
const uninitialized = (
|
|
78266
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
78287
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
78288
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
78267
78289
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
78268
78290
|
const propName = uninitialized.name;
|
|
78269
78291
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -88374,16 +88396,17 @@ function transformClassFields(context) {
|
|
|
88374
88396
|
if (isAssignmentExpression(node)) {
|
|
88375
88397
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
88376
88398
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
88377
|
-
const
|
|
88399
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
88378
88400
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
88379
|
-
return factory2.updateBinaryExpression(node,
|
|
88401
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
88380
88402
|
}
|
|
88381
|
-
|
|
88382
|
-
|
|
88403
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
88404
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
88405
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
88383
88406
|
if (info) {
|
|
88384
88407
|
return setTextRange(
|
|
88385
88408
|
setOriginalNode(
|
|
88386
|
-
createPrivateIdentifierAssignment(info,
|
|
88409
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
88387
88410
|
node
|
|
88388
88411
|
),
|
|
88389
88412
|
node
|
|
@@ -91318,10 +91341,14 @@ function transformESDecorators(context) {
|
|
|
91318
91341
|
visitor
|
|
91319
91342
|
);
|
|
91320
91343
|
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
91321
|
-
|
|
91322
|
-
|
|
91323
|
-
|
|
91324
|
-
|
|
91344
|
+
if (superStatementIndex >= 0) {
|
|
91345
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart));
|
|
91346
|
+
addRange(statements, initializerStatements);
|
|
91347
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1));
|
|
91348
|
+
} else {
|
|
91349
|
+
addRange(statements, initializerStatements);
|
|
91350
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement));
|
|
91351
|
+
}
|
|
91325
91352
|
body = factory2.createBlock(
|
|
91326
91353
|
statements,
|
|
91327
91354
|
/*multiLine*/
|
package/lib/tsserver.js
CHANGED
|
@@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2286
2286
|
|
|
2287
2287
|
// src/compiler/corePublic.ts
|
|
2288
2288
|
var versionMajorMinor = "5.1";
|
|
2289
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2289
|
+
var version = `${versionMajorMinor}.0-dev.20230329`;
|
|
2290
2290
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2291
2291
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2292
2292
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -11233,7 +11233,8 @@ var Diagnostics = {
|
|
|
11233
11233
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
11234
11234
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
11235
11235
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
11236
|
-
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.")
|
|
11236
|
+
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."),
|
|
11237
|
+
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}'")
|
|
11237
11238
|
};
|
|
11238
11239
|
|
|
11239
11240
|
// src/compiler/scanner.ts
|
|
@@ -54554,6 +54555,7 @@ function createTypeChecker(host) {
|
|
|
54554
54555
|
), 0 /* None */);
|
|
54555
54556
|
}
|
|
54556
54557
|
function serializeMaybeAliasAssignment(symbol) {
|
|
54558
|
+
var _a2;
|
|
54557
54559
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
54558
54560
|
return false;
|
|
54559
54561
|
}
|
|
@@ -54633,7 +54635,7 @@ function createTypeChecker(host) {
|
|
|
54633
54635
|
void 0,
|
|
54634
54636
|
serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
|
|
54635
54637
|
)
|
|
54636
|
-
], 2 /* Const */)
|
|
54638
|
+
], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 265 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
|
|
54637
54639
|
);
|
|
54638
54640
|
addResult(
|
|
54639
54641
|
statement,
|
|
@@ -54669,7 +54671,7 @@ function createTypeChecker(host) {
|
|
|
54669
54671
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
54670
54672
|
return [];
|
|
54671
54673
|
}
|
|
54672
|
-
if (p.flags & 4194304 /* Prototype */ || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
54674
|
+
if (p.flags & 4194304 /* Prototype */ || p.escapedName === "constructor" || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
54673
54675
|
return [];
|
|
54674
54676
|
}
|
|
54675
54677
|
const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0);
|
|
@@ -58169,6 +58171,9 @@ function createTypeChecker(host) {
|
|
|
58169
58171
|
return type.resolvedDefaultConstraint;
|
|
58170
58172
|
}
|
|
58171
58173
|
function getConstraintOfDistributiveConditionalType(type) {
|
|
58174
|
+
if (type.resolvedConstraintOfDistributive !== void 0) {
|
|
58175
|
+
return type.resolvedConstraintOfDistributive || void 0;
|
|
58176
|
+
}
|
|
58172
58177
|
if (type.root.isDistributive && type.restrictiveInstantiation !== type) {
|
|
58173
58178
|
const simplified = getSimplifiedType(
|
|
58174
58179
|
type.checkType,
|
|
@@ -58179,10 +58184,12 @@ function createTypeChecker(host) {
|
|
|
58179
58184
|
if (constraint && constraint !== type.checkType) {
|
|
58180
58185
|
const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
|
|
58181
58186
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
58187
|
+
type.resolvedConstraintOfDistributive = instantiated;
|
|
58182
58188
|
return instantiated;
|
|
58183
58189
|
}
|
|
58184
58190
|
}
|
|
58185
58191
|
}
|
|
58192
|
+
type.resolvedConstraintOfDistributive = false;
|
|
58186
58193
|
return void 0;
|
|
58187
58194
|
}
|
|
58188
58195
|
function getConstraintFromConditionalType(type) {
|
|
@@ -76870,7 +76877,7 @@ function createTypeChecker(host) {
|
|
|
76870
76877
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
76871
76878
|
const functionFlags = getFunctionFlags(func);
|
|
76872
76879
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
76873
|
-
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
76880
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */ | 2 /* Unknown */)) {
|
|
76874
76881
|
return;
|
|
76875
76882
|
}
|
|
76876
76883
|
if (func.kind === 171 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 239 /* Block */ || !functionHasImplicitReturn(func)) {
|
|
@@ -82842,8 +82849,9 @@ function createTypeChecker(host) {
|
|
|
82842
82849
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
82843
82850
|
}
|
|
82844
82851
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
82845
|
-
var _a2, _b, _c, _d;
|
|
82852
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
82846
82853
|
const baseProperties = getPropertiesOfType(baseType);
|
|
82854
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
82847
82855
|
basePropertyCheck:
|
|
82848
82856
|
for (const baseProperty of baseProperties) {
|
|
82849
82857
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -82869,20 +82877,34 @@ function createTypeChecker(host) {
|
|
|
82869
82877
|
continue basePropertyCheck;
|
|
82870
82878
|
}
|
|
82871
82879
|
}
|
|
82872
|
-
if (
|
|
82873
|
-
error(
|
|
82880
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
82881
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
82874
82882
|
derivedClassDecl,
|
|
82875
|
-
Diagnostics.
|
|
82876
|
-
|
|
82883
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
82884
|
+
typeToString(type),
|
|
82877
82885
|
typeToString(baseType)
|
|
82878
82886
|
);
|
|
82887
|
+
}
|
|
82888
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
82889
|
+
addRelatedInfo(
|
|
82890
|
+
inheritedAbstractMemberNotImplementedError,
|
|
82891
|
+
createDiagnosticForNode(
|
|
82892
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
82893
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
82894
|
+
symbolToString(baseProperty),
|
|
82895
|
+
typeToString(baseType)
|
|
82896
|
+
)
|
|
82897
|
+
);
|
|
82879
82898
|
} else {
|
|
82880
|
-
|
|
82881
|
-
|
|
82882
|
-
|
|
82883
|
-
|
|
82884
|
-
|
|
82885
|
-
|
|
82899
|
+
addRelatedInfo(
|
|
82900
|
+
inheritedAbstractMemberNotImplementedError,
|
|
82901
|
+
createDiagnosticForNode(
|
|
82902
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
82903
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
82904
|
+
typeToString(type),
|
|
82905
|
+
symbolToString(baseProperty),
|
|
82906
|
+
typeToString(baseType)
|
|
82907
|
+
)
|
|
82886
82908
|
);
|
|
82887
82909
|
}
|
|
82888
82910
|
}
|
|
@@ -82895,7 +82917,7 @@ function createTypeChecker(host) {
|
|
|
82895
82917
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
82896
82918
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
82897
82919
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
82898
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
82920
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
82899
82921
|
continue;
|
|
82900
82922
|
}
|
|
82901
82923
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -82904,8 +82926,8 @@ function createTypeChecker(host) {
|
|
|
82904
82926
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
82905
82927
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
82906
82928
|
} else if (useDefineForClassFields) {
|
|
82907
|
-
const uninitialized = (
|
|
82908
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
82929
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
82930
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
82909
82931
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
82910
82932
|
const propName = uninitialized.name;
|
|
82911
82933
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -93187,16 +93209,17 @@ function transformClassFields(context) {
|
|
|
93187
93209
|
if (isAssignmentExpression(node)) {
|
|
93188
93210
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
93189
93211
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
93190
|
-
const
|
|
93212
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
93191
93213
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
93192
|
-
return factory2.updateBinaryExpression(node,
|
|
93214
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
93193
93215
|
}
|
|
93194
|
-
|
|
93195
|
-
|
|
93216
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
93217
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
93218
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
93196
93219
|
if (info) {
|
|
93197
93220
|
return setTextRange(
|
|
93198
93221
|
setOriginalNode(
|
|
93199
|
-
createPrivateIdentifierAssignment(info,
|
|
93222
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
93200
93223
|
node
|
|
93201
93224
|
),
|
|
93202
93225
|
node
|
|
@@ -96131,10 +96154,14 @@ function transformESDecorators(context) {
|
|
|
96131
96154
|
visitor
|
|
96132
96155
|
);
|
|
96133
96156
|
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
96134
|
-
|
|
96135
|
-
|
|
96136
|
-
|
|
96137
|
-
|
|
96157
|
+
if (superStatementIndex >= 0) {
|
|
96158
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart));
|
|
96159
|
+
addRange(statements, initializerStatements);
|
|
96160
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1));
|
|
96161
|
+
} else {
|
|
96162
|
+
addRange(statements, initializerStatements);
|
|
96163
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement));
|
|
96164
|
+
}
|
|
96138
96165
|
body = factory2.createBlock(
|
|
96139
96166
|
statements,
|
|
96140
96167
|
/*multiLine*/
|
|
@@ -144818,8 +144845,7 @@ function getTypesPackageNameToInstall(packageName, host, diagCode) {
|
|
|
144818
144845
|
|
|
144819
144846
|
// src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts
|
|
144820
144847
|
var errorCodes30 = [
|
|
144821
|
-
Diagnostics.
|
|
144822
|
-
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code
|
|
144848
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code
|
|
144823
144849
|
];
|
|
144824
144850
|
var fixId25 = "fixClassDoesntImplementInheritedAbstractMember";
|
|
144825
144851
|
registerCodeFix({
|
|
@@ -152526,7 +152552,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
|
|
|
152526
152552
|
const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value));
|
|
152527
152553
|
return { kind: 2 /* Types */, types: literals, isNewIdentifier: false };
|
|
152528
152554
|
default:
|
|
152529
|
-
return fromContextualType();
|
|
152555
|
+
return fromContextualType() || fromContextualType(0 /* None */);
|
|
152530
152556
|
}
|
|
152531
152557
|
function fromContextualType(contextFlags = 4 /* Completions */) {
|
|
152532
152558
|
const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags));
|
|
@@ -161591,9 +161617,9 @@ function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParame
|
|
|
161591
161617
|
}
|
|
161592
161618
|
callArguments.push(factory.createIdentifier(name));
|
|
161593
161619
|
});
|
|
161594
|
-
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration:
|
|
161620
|
+
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration: getFirstDeclarationBeforePosition(type, context.startPosition) }));
|
|
161595
161621
|
const sortedTypeParametersAndDeclarations = typeParametersAndDeclarations.sort(compareTypesByDeclarationOrder);
|
|
161596
|
-
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : sortedTypeParametersAndDeclarations
|
|
161622
|
+
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : mapDefined(sortedTypeParametersAndDeclarations, ({ declaration }) => declaration);
|
|
161597
161623
|
const callTypeArguments = typeParameters !== void 0 ? typeParameters.map((decl) => factory.createTypeReferenceNode(
|
|
161598
161624
|
decl.name,
|
|
161599
161625
|
/*typeArguments*/
|
|
@@ -162070,12 +162096,12 @@ function getContainingVariableDeclarationIfInList(node, scope) {
|
|
|
162070
162096
|
node = node.parent;
|
|
162071
162097
|
}
|
|
162072
162098
|
}
|
|
162073
|
-
function
|
|
162099
|
+
function getFirstDeclarationBeforePosition(type, position) {
|
|
162074
162100
|
let firstDeclaration;
|
|
162075
162101
|
const symbol = type.symbol;
|
|
162076
162102
|
if (symbol && symbol.declarations) {
|
|
162077
162103
|
for (const declaration of symbol.declarations) {
|
|
162078
|
-
if (firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) {
|
|
162104
|
+
if ((firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) && declaration.pos < position) {
|
|
162079
162105
|
firstDeclaration = declaration;
|
|
162080
162106
|
}
|
|
162081
162107
|
}
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230329`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -9056,7 +9056,8 @@ ${lanes.join("\n")}
|
|
|
9056
9056
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
9057
9057
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
9058
9058
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
9059
|
-
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.")
|
|
9059
|
+
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."),
|
|
9060
|
+
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}'")
|
|
9060
9061
|
};
|
|
9061
9062
|
}
|
|
9062
9063
|
});
|
|
@@ -52362,6 +52363,7 @@ ${lanes.join("\n")}
|
|
|
52362
52363
|
), 0 /* None */);
|
|
52363
52364
|
}
|
|
52364
52365
|
function serializeMaybeAliasAssignment(symbol) {
|
|
52366
|
+
var _a2;
|
|
52365
52367
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
52366
52368
|
return false;
|
|
52367
52369
|
}
|
|
@@ -52441,7 +52443,7 @@ ${lanes.join("\n")}
|
|
|
52441
52443
|
void 0,
|
|
52442
52444
|
serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
|
|
52443
52445
|
)
|
|
52444
|
-
], 2 /* Const */)
|
|
52446
|
+
], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 265 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
|
|
52445
52447
|
);
|
|
52446
52448
|
addResult(
|
|
52447
52449
|
statement,
|
|
@@ -52477,7 +52479,7 @@ ${lanes.join("\n")}
|
|
|
52477
52479
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
52478
52480
|
return [];
|
|
52479
52481
|
}
|
|
52480
|
-
if (p.flags & 4194304 /* Prototype */ || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
52482
|
+
if (p.flags & 4194304 /* Prototype */ || p.escapedName === "constructor" || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
52481
52483
|
return [];
|
|
52482
52484
|
}
|
|
52483
52485
|
const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0);
|
|
@@ -55977,6 +55979,9 @@ ${lanes.join("\n")}
|
|
|
55977
55979
|
return type.resolvedDefaultConstraint;
|
|
55978
55980
|
}
|
|
55979
55981
|
function getConstraintOfDistributiveConditionalType(type) {
|
|
55982
|
+
if (type.resolvedConstraintOfDistributive !== void 0) {
|
|
55983
|
+
return type.resolvedConstraintOfDistributive || void 0;
|
|
55984
|
+
}
|
|
55980
55985
|
if (type.root.isDistributive && type.restrictiveInstantiation !== type) {
|
|
55981
55986
|
const simplified = getSimplifiedType(
|
|
55982
55987
|
type.checkType,
|
|
@@ -55987,10 +55992,12 @@ ${lanes.join("\n")}
|
|
|
55987
55992
|
if (constraint && constraint !== type.checkType) {
|
|
55988
55993
|
const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
|
|
55989
55994
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
55995
|
+
type.resolvedConstraintOfDistributive = instantiated;
|
|
55990
55996
|
return instantiated;
|
|
55991
55997
|
}
|
|
55992
55998
|
}
|
|
55993
55999
|
}
|
|
56000
|
+
type.resolvedConstraintOfDistributive = false;
|
|
55994
56001
|
return void 0;
|
|
55995
56002
|
}
|
|
55996
56003
|
function getConstraintFromConditionalType(type) {
|
|
@@ -74678,7 +74685,7 @@ ${lanes.join("\n")}
|
|
|
74678
74685
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
74679
74686
|
const functionFlags = getFunctionFlags(func);
|
|
74680
74687
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
74681
|
-
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
74688
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */ | 2 /* Unknown */)) {
|
|
74682
74689
|
return;
|
|
74683
74690
|
}
|
|
74684
74691
|
if (func.kind === 171 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 239 /* Block */ || !functionHasImplicitReturn(func)) {
|
|
@@ -80650,8 +80657,9 @@ ${lanes.join("\n")}
|
|
|
80650
80657
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
80651
80658
|
}
|
|
80652
80659
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
80653
|
-
var _a2, _b, _c, _d;
|
|
80660
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
80654
80661
|
const baseProperties = getPropertiesOfType(baseType);
|
|
80662
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
80655
80663
|
basePropertyCheck:
|
|
80656
80664
|
for (const baseProperty of baseProperties) {
|
|
80657
80665
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -80677,20 +80685,34 @@ ${lanes.join("\n")}
|
|
|
80677
80685
|
continue basePropertyCheck;
|
|
80678
80686
|
}
|
|
80679
80687
|
}
|
|
80680
|
-
if (
|
|
80681
|
-
error(
|
|
80688
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
80689
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
80682
80690
|
derivedClassDecl,
|
|
80683
|
-
Diagnostics.
|
|
80684
|
-
|
|
80691
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
80692
|
+
typeToString(type),
|
|
80685
80693
|
typeToString(baseType)
|
|
80686
80694
|
);
|
|
80695
|
+
}
|
|
80696
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
80697
|
+
addRelatedInfo(
|
|
80698
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80699
|
+
createDiagnosticForNode(
|
|
80700
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
80701
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
80702
|
+
symbolToString(baseProperty),
|
|
80703
|
+
typeToString(baseType)
|
|
80704
|
+
)
|
|
80705
|
+
);
|
|
80687
80706
|
} else {
|
|
80688
|
-
|
|
80689
|
-
|
|
80690
|
-
|
|
80691
|
-
|
|
80692
|
-
|
|
80693
|
-
|
|
80707
|
+
addRelatedInfo(
|
|
80708
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80709
|
+
createDiagnosticForNode(
|
|
80710
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
80711
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
80712
|
+
typeToString(type),
|
|
80713
|
+
symbolToString(baseProperty),
|
|
80714
|
+
typeToString(baseType)
|
|
80715
|
+
)
|
|
80694
80716
|
);
|
|
80695
80717
|
}
|
|
80696
80718
|
}
|
|
@@ -80703,7 +80725,7 @@ ${lanes.join("\n")}
|
|
|
80703
80725
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
80704
80726
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
80705
80727
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
80706
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
80728
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
80707
80729
|
continue;
|
|
80708
80730
|
}
|
|
80709
80731
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -80712,8 +80734,8 @@ ${lanes.join("\n")}
|
|
|
80712
80734
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
80713
80735
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
80714
80736
|
} else if (useDefineForClassFields) {
|
|
80715
|
-
const uninitialized = (
|
|
80716
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
80737
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
80738
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
80717
80739
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
80718
80740
|
const propName = uninitialized.name;
|
|
80719
80741
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -91170,16 +91192,17 @@ ${lanes.join("\n")}
|
|
|
91170
91192
|
if (isAssignmentExpression(node)) {
|
|
91171
91193
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
91172
91194
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
91173
|
-
const
|
|
91195
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
91174
91196
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
91175
|
-
return factory2.updateBinaryExpression(node,
|
|
91197
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
91176
91198
|
}
|
|
91177
|
-
|
|
91178
|
-
|
|
91199
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
91200
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
91201
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
91179
91202
|
if (info) {
|
|
91180
91203
|
return setTextRange(
|
|
91181
91204
|
setOriginalNode(
|
|
91182
|
-
createPrivateIdentifierAssignment(info,
|
|
91205
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
91183
91206
|
node
|
|
91184
91207
|
),
|
|
91185
91208
|
node
|
|
@@ -94132,10 +94155,14 @@ ${lanes.join("\n")}
|
|
|
94132
94155
|
visitor
|
|
94133
94156
|
);
|
|
94134
94157
|
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
94135
|
-
|
|
94136
|
-
|
|
94137
|
-
|
|
94138
|
-
|
|
94158
|
+
if (superStatementIndex >= 0) {
|
|
94159
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart));
|
|
94160
|
+
addRange(statements, initializerStatements);
|
|
94161
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1));
|
|
94162
|
+
} else {
|
|
94163
|
+
addRange(statements, initializerStatements);
|
|
94164
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement));
|
|
94165
|
+
}
|
|
94139
94166
|
body = factory2.createBlock(
|
|
94140
94167
|
statements,
|
|
94141
94168
|
/*multiLine*/
|
|
@@ -143541,8 +143568,7 @@ ${lanes.join("\n")}
|
|
|
143541
143568
|
init_ts4();
|
|
143542
143569
|
init_ts_codefix();
|
|
143543
143570
|
errorCodes30 = [
|
|
143544
|
-
Diagnostics.
|
|
143545
|
-
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code
|
|
143571
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code
|
|
143546
143572
|
];
|
|
143547
143573
|
fixId25 = "fixClassDoesntImplementInheritedAbstractMember";
|
|
143548
143574
|
registerCodeFix({
|
|
@@ -151623,7 +151649,7 @@ ${lanes.join("\n")}
|
|
|
151623
151649
|
const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value));
|
|
151624
151650
|
return { kind: 2 /* Types */, types: literals, isNewIdentifier: false };
|
|
151625
151651
|
default:
|
|
151626
|
-
return fromContextualType();
|
|
151652
|
+
return fromContextualType() || fromContextualType(0 /* None */);
|
|
151627
151653
|
}
|
|
151628
151654
|
function fromContextualType(contextFlags = 4 /* Completions */) {
|
|
151629
151655
|
const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags));
|
|
@@ -160861,9 +160887,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160861
160887
|
}
|
|
160862
160888
|
callArguments.push(factory.createIdentifier(name));
|
|
160863
160889
|
});
|
|
160864
|
-
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration:
|
|
160890
|
+
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration: getFirstDeclarationBeforePosition(type, context.startPosition) }));
|
|
160865
160891
|
const sortedTypeParametersAndDeclarations = typeParametersAndDeclarations.sort(compareTypesByDeclarationOrder);
|
|
160866
|
-
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : sortedTypeParametersAndDeclarations
|
|
160892
|
+
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : mapDefined(sortedTypeParametersAndDeclarations, ({ declaration }) => declaration);
|
|
160867
160893
|
const callTypeArguments = typeParameters !== void 0 ? typeParameters.map((decl) => factory.createTypeReferenceNode(
|
|
160868
160894
|
decl.name,
|
|
160869
160895
|
/*typeArguments*/
|
|
@@ -161340,12 +161366,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161340
161366
|
node = node.parent;
|
|
161341
161367
|
}
|
|
161342
161368
|
}
|
|
161343
|
-
function
|
|
161369
|
+
function getFirstDeclarationBeforePosition(type, position) {
|
|
161344
161370
|
let firstDeclaration;
|
|
161345
161371
|
const symbol = type.symbol;
|
|
161346
161372
|
if (symbol && symbol.declarations) {
|
|
161347
161373
|
for (const declaration of symbol.declarations) {
|
|
161348
|
-
if (firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) {
|
|
161374
|
+
if ((firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) && declaration.pos < position) {
|
|
161349
161375
|
firstDeclaration = declaration;
|
|
161350
161376
|
}
|
|
161351
161377
|
}
|
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.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230329`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -9056,7 +9056,8 @@ ${lanes.join("\n")}
|
|
|
9056
9056
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
9057
9057
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
9058
9058
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
9059
|
-
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.")
|
|
9059
|
+
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."),
|
|
9060
|
+
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}'")
|
|
9060
9061
|
};
|
|
9061
9062
|
}
|
|
9062
9063
|
});
|
|
@@ -52362,6 +52363,7 @@ ${lanes.join("\n")}
|
|
|
52362
52363
|
), 0 /* None */);
|
|
52363
52364
|
}
|
|
52364
52365
|
function serializeMaybeAliasAssignment(symbol) {
|
|
52366
|
+
var _a2;
|
|
52365
52367
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
52366
52368
|
return false;
|
|
52367
52369
|
}
|
|
@@ -52441,7 +52443,7 @@ ${lanes.join("\n")}
|
|
|
52441
52443
|
void 0,
|
|
52442
52444
|
serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
|
|
52443
52445
|
)
|
|
52444
|
-
], 2 /* Const */)
|
|
52446
|
+
], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 265 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
|
|
52445
52447
|
);
|
|
52446
52448
|
addResult(
|
|
52447
52449
|
statement,
|
|
@@ -52477,7 +52479,7 @@ ${lanes.join("\n")}
|
|
|
52477
52479
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
52478
52480
|
return [];
|
|
52479
52481
|
}
|
|
52480
|
-
if (p.flags & 4194304 /* Prototype */ || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
52482
|
+
if (p.flags & 4194304 /* Prototype */ || p.escapedName === "constructor" || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
52481
52483
|
return [];
|
|
52482
52484
|
}
|
|
52483
52485
|
const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0);
|
|
@@ -55977,6 +55979,9 @@ ${lanes.join("\n")}
|
|
|
55977
55979
|
return type.resolvedDefaultConstraint;
|
|
55978
55980
|
}
|
|
55979
55981
|
function getConstraintOfDistributiveConditionalType(type) {
|
|
55982
|
+
if (type.resolvedConstraintOfDistributive !== void 0) {
|
|
55983
|
+
return type.resolvedConstraintOfDistributive || void 0;
|
|
55984
|
+
}
|
|
55980
55985
|
if (type.root.isDistributive && type.restrictiveInstantiation !== type) {
|
|
55981
55986
|
const simplified = getSimplifiedType(
|
|
55982
55987
|
type.checkType,
|
|
@@ -55987,10 +55992,12 @@ ${lanes.join("\n")}
|
|
|
55987
55992
|
if (constraint && constraint !== type.checkType) {
|
|
55988
55993
|
const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
|
|
55989
55994
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
55995
|
+
type.resolvedConstraintOfDistributive = instantiated;
|
|
55990
55996
|
return instantiated;
|
|
55991
55997
|
}
|
|
55992
55998
|
}
|
|
55993
55999
|
}
|
|
56000
|
+
type.resolvedConstraintOfDistributive = false;
|
|
55994
56001
|
return void 0;
|
|
55995
56002
|
}
|
|
55996
56003
|
function getConstraintFromConditionalType(type) {
|
|
@@ -74678,7 +74685,7 @@ ${lanes.join("\n")}
|
|
|
74678
74685
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
74679
74686
|
const functionFlags = getFunctionFlags(func);
|
|
74680
74687
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
74681
|
-
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
74688
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */ | 2 /* Unknown */)) {
|
|
74682
74689
|
return;
|
|
74683
74690
|
}
|
|
74684
74691
|
if (func.kind === 171 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 239 /* Block */ || !functionHasImplicitReturn(func)) {
|
|
@@ -80650,8 +80657,9 @@ ${lanes.join("\n")}
|
|
|
80650
80657
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
80651
80658
|
}
|
|
80652
80659
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
80653
|
-
var _a2, _b, _c, _d;
|
|
80660
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
80654
80661
|
const baseProperties = getPropertiesOfType(baseType);
|
|
80662
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
80655
80663
|
basePropertyCheck:
|
|
80656
80664
|
for (const baseProperty of baseProperties) {
|
|
80657
80665
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -80677,20 +80685,34 @@ ${lanes.join("\n")}
|
|
|
80677
80685
|
continue basePropertyCheck;
|
|
80678
80686
|
}
|
|
80679
80687
|
}
|
|
80680
|
-
if (
|
|
80681
|
-
error(
|
|
80688
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
80689
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
80682
80690
|
derivedClassDecl,
|
|
80683
|
-
Diagnostics.
|
|
80684
|
-
|
|
80691
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
80692
|
+
typeToString(type),
|
|
80685
80693
|
typeToString(baseType)
|
|
80686
80694
|
);
|
|
80695
|
+
}
|
|
80696
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
80697
|
+
addRelatedInfo(
|
|
80698
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80699
|
+
createDiagnosticForNode(
|
|
80700
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
80701
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
80702
|
+
symbolToString(baseProperty),
|
|
80703
|
+
typeToString(baseType)
|
|
80704
|
+
)
|
|
80705
|
+
);
|
|
80687
80706
|
} else {
|
|
80688
|
-
|
|
80689
|
-
|
|
80690
|
-
|
|
80691
|
-
|
|
80692
|
-
|
|
80693
|
-
|
|
80707
|
+
addRelatedInfo(
|
|
80708
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80709
|
+
createDiagnosticForNode(
|
|
80710
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
80711
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
80712
|
+
typeToString(type),
|
|
80713
|
+
symbolToString(baseProperty),
|
|
80714
|
+
typeToString(baseType)
|
|
80715
|
+
)
|
|
80694
80716
|
);
|
|
80695
80717
|
}
|
|
80696
80718
|
}
|
|
@@ -80703,7 +80725,7 @@ ${lanes.join("\n")}
|
|
|
80703
80725
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
80704
80726
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
80705
80727
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
80706
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
80728
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
80707
80729
|
continue;
|
|
80708
80730
|
}
|
|
80709
80731
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -80712,8 +80734,8 @@ ${lanes.join("\n")}
|
|
|
80712
80734
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
80713
80735
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
80714
80736
|
} else if (useDefineForClassFields) {
|
|
80715
|
-
const uninitialized = (
|
|
80716
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
80737
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
80738
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
80717
80739
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
80718
80740
|
const propName = uninitialized.name;
|
|
80719
80741
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -91170,16 +91192,17 @@ ${lanes.join("\n")}
|
|
|
91170
91192
|
if (isAssignmentExpression(node)) {
|
|
91171
91193
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
91172
91194
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
91173
|
-
const
|
|
91195
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
91174
91196
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
91175
|
-
return factory2.updateBinaryExpression(node,
|
|
91197
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
91176
91198
|
}
|
|
91177
|
-
|
|
91178
|
-
|
|
91199
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
91200
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
91201
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
91179
91202
|
if (info) {
|
|
91180
91203
|
return setTextRange(
|
|
91181
91204
|
setOriginalNode(
|
|
91182
|
-
createPrivateIdentifierAssignment(info,
|
|
91205
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
91183
91206
|
node
|
|
91184
91207
|
),
|
|
91185
91208
|
node
|
|
@@ -94132,10 +94155,14 @@ ${lanes.join("\n")}
|
|
|
94132
94155
|
visitor
|
|
94133
94156
|
);
|
|
94134
94157
|
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
94135
|
-
|
|
94136
|
-
|
|
94137
|
-
|
|
94138
|
-
|
|
94158
|
+
if (superStatementIndex >= 0) {
|
|
94159
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart));
|
|
94160
|
+
addRange(statements, initializerStatements);
|
|
94161
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1));
|
|
94162
|
+
} else {
|
|
94163
|
+
addRange(statements, initializerStatements);
|
|
94164
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement));
|
|
94165
|
+
}
|
|
94139
94166
|
body = factory2.createBlock(
|
|
94140
94167
|
statements,
|
|
94141
94168
|
/*multiLine*/
|
|
@@ -143555,8 +143582,7 @@ ${lanes.join("\n")}
|
|
|
143555
143582
|
init_ts4();
|
|
143556
143583
|
init_ts_codefix();
|
|
143557
143584
|
errorCodes30 = [
|
|
143558
|
-
Diagnostics.
|
|
143559
|
-
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code
|
|
143585
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code
|
|
143560
143586
|
];
|
|
143561
143587
|
fixId25 = "fixClassDoesntImplementInheritedAbstractMember";
|
|
143562
143588
|
registerCodeFix({
|
|
@@ -151637,7 +151663,7 @@ ${lanes.join("\n")}
|
|
|
151637
151663
|
const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value));
|
|
151638
151664
|
return { kind: 2 /* Types */, types: literals, isNewIdentifier: false };
|
|
151639
151665
|
default:
|
|
151640
|
-
return fromContextualType();
|
|
151666
|
+
return fromContextualType() || fromContextualType(0 /* None */);
|
|
151641
151667
|
}
|
|
151642
151668
|
function fromContextualType(contextFlags = 4 /* Completions */) {
|
|
151643
151669
|
const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags));
|
|
@@ -160875,9 +160901,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160875
160901
|
}
|
|
160876
160902
|
callArguments.push(factory.createIdentifier(name));
|
|
160877
160903
|
});
|
|
160878
|
-
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration:
|
|
160904
|
+
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration: getFirstDeclarationBeforePosition(type, context.startPosition) }));
|
|
160879
160905
|
const sortedTypeParametersAndDeclarations = typeParametersAndDeclarations.sort(compareTypesByDeclarationOrder);
|
|
160880
|
-
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : sortedTypeParametersAndDeclarations
|
|
160906
|
+
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : mapDefined(sortedTypeParametersAndDeclarations, ({ declaration }) => declaration);
|
|
160881
160907
|
const callTypeArguments = typeParameters !== void 0 ? typeParameters.map((decl) => factory.createTypeReferenceNode(
|
|
160882
160908
|
decl.name,
|
|
160883
160909
|
/*typeArguments*/
|
|
@@ -161354,12 +161380,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161354
161380
|
node = node.parent;
|
|
161355
161381
|
}
|
|
161356
161382
|
}
|
|
161357
|
-
function
|
|
161383
|
+
function getFirstDeclarationBeforePosition(type, position) {
|
|
161358
161384
|
let firstDeclaration;
|
|
161359
161385
|
const symbol = type.symbol;
|
|
161360
161386
|
if (symbol && symbol.declarations) {
|
|
161361
161387
|
for (const declaration of symbol.declarations) {
|
|
161362
|
-
if (firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) {
|
|
161388
|
+
if ((firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) && declaration.pos < position) {
|
|
161363
161389
|
firstDeclaration = declaration;
|
|
161364
161390
|
}
|
|
161365
161391
|
}
|
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.1";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230329`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -7120,7 +7120,8 @@ var Diagnostics = {
|
|
|
7120
7120
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
7121
7121
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
7122
7122
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
7123
|
-
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.")
|
|
7123
|
+
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."),
|
|
7124
|
+
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}'")
|
|
7124
7125
|
};
|
|
7125
7126
|
|
|
7126
7127
|
// src/compiler/scanner.ts
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.1.0-dev.
|
|
5
|
+
"version": "5.1.0-dev.20230329",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"node": "14.21.1",
|
|
114
114
|
"npm": "8.19.3"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "4d4d5f2845c6f5153b1d1ba44dca0d92578871fb"
|
|
117
117
|
}
|