@typescript-deploys/pr-build 5.1.0-pr-50951-3 → 5.1.0-pr-53258-7

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/README.md CHANGED
@@ -17,13 +17,13 @@ Find others who are using TypeScript at [our community page](https://www.typescr
17
17
  For the latest stable version:
18
18
 
19
19
  ```bash
20
- npm install -g typescript
20
+ npm install -D typescript
21
21
  ```
22
22
 
23
23
  For our nightly builds:
24
24
 
25
25
  ```bash
26
- npm install -g typescript@next
26
+ npm install -D typescript@next
27
27
  ```
28
28
 
29
29
  ## Contribute
package/lib/tsc.js CHANGED
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.1";
26
- var version = `${versionMajorMinor}.0-insiders.20230313`;
26
+ var version = `${versionMajorMinor}.0-insiders.20230314`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -5935,6 +5935,7 @@ var Diagnostics = {
5935
5935
  Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5: diag(1250, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."),
5936
5936
  Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode: diag(1251, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."),
5937
5937
  Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode: diag(1252, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."),
5938
+ Abstract_properties_can_only_appear_within_an_abstract_class: diag(1253, 1 /* Error */, "Abstract_properties_can_only_appear_within_an_abstract_class_1253", "Abstract properties can only appear within an abstract class."),
5938
5939
  A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference: diag(1254, 1 /* Error */, "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254", "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),
5939
5940
  A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, 1 /* Error */, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."),
5940
5941
  A_required_element_cannot_follow_an_optional_element: diag(1257, 1 /* Error */, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."),
@@ -10281,36 +10282,32 @@ function getModifiers(node) {
10281
10282
  return filter(node.modifiers, isModifier);
10282
10283
  }
10283
10284
  }
10284
- function getJSDocParameterTagsWorker(node, noCache) {
10285
- const declaration = getRootDeclaration(node);
10286
- if (isParameter(declaration)) {
10287
- const name = node.name;
10288
- const signatureDeclaration = declaration.parent;
10289
- const jsDocParameterTags = filter(getJSDocTagsWorker(signatureDeclaration, noCache), isJSDocParameterTag);
10290
- if (length(jsDocParameterTags) === 0) {
10291
- return emptyArray;
10292
- }
10293
- if (isIdentifier(name)) {
10294
- return filter(jsDocParameterTags, (tag) => isIdentifier(tag.name) && tag.name.escapedText === name.escapedText);
10295
- }
10296
- const i = signatureDeclaration.parameters.indexOf(declaration);
10297
- Debug.assert(i > -1, "Parameters should always be in their parents' parameter list");
10298
- if (i < length(jsDocParameterTags)) {
10299
- return [jsDocParameterTags[i]];
10285
+ function getJSDocParameterTagsWorker(param, noCache) {
10286
+ if (param.name) {
10287
+ if (isIdentifier(param.name)) {
10288
+ const name = param.name.escapedText;
10289
+ return getJSDocTagsWorker(param.parent, noCache).filter((tag) => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name);
10290
+ } else {
10291
+ const i = param.parent.parameters.indexOf(param);
10292
+ Debug.assert(i > -1, "Parameters should always be in their parents' parameter list");
10293
+ const paramTags = getJSDocTagsWorker(param.parent, noCache).filter(isJSDocParameterTag);
10294
+ if (i < paramTags.length) {
10295
+ return [paramTags[i]];
10296
+ }
10300
10297
  }
10301
10298
  }
10302
10299
  return emptyArray;
10303
10300
  }
10304
- function getJSDocParameterTags(node) {
10301
+ function getJSDocParameterTags(param) {
10305
10302
  return getJSDocParameterTagsWorker(
10306
- node,
10303
+ param,
10307
10304
  /*noCache*/
10308
10305
  false
10309
10306
  );
10310
10307
  }
10311
- function getJSDocParameterTagsNoCache(node) {
10308
+ function getJSDocParameterTagsNoCache(param) {
10312
10309
  return getJSDocParameterTagsWorker(
10313
- node,
10310
+ param,
10314
10311
  /*noCache*/
10315
10312
  true
10316
10313
  );
@@ -13738,7 +13735,7 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
13738
13735
  if (hasJSDocNodes(node)) {
13739
13736
  result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
13740
13737
  }
13741
- if (node.kind === 167 /* Parameter */ || node.kind === 206 /* BindingElement */) {
13738
+ if (node.kind === 167 /* Parameter */) {
13742
13739
  result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
13743
13740
  break;
13744
13741
  }
@@ -42685,6 +42682,7 @@ function createTypeChecker(host) {
42685
42682
  var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
42686
42683
  var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
42687
42684
  var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
42685
+ var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
42688
42686
  var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
42689
42687
  var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
42690
42688
  var checkBinaryExpression = createCheckBinaryExpression();
@@ -53953,6 +53951,13 @@ function createTypeChecker(host) {
53953
53951
  function isConflictingPrivateProperty(prop) {
53954
53952
  return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
53955
53953
  }
53954
+ function isGenericReducibleType(type) {
53955
+ return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
53956
+ }
53957
+ function isReducibleIntersection(type) {
53958
+ const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
53959
+ return getReducedType(uniqueFilled) !== uniqueFilled;
53960
+ }
53956
53961
  function elaborateNeverIntersection(errorInfo, type) {
53957
53962
  if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 33554432 /* IsNeverIntersection */) {
53958
53963
  const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
@@ -56322,10 +56327,10 @@ function createTypeChecker(host) {
56322
56327
  }
56323
56328
  return links.resolvedType;
56324
56329
  }
56325
- function createIndexType(type, stringsOnly) {
56330
+ function createIndexType(type, indexFlags) {
56326
56331
  const result = createType(4194304 /* Index */);
56327
56332
  result.type = type;
56328
- result.stringsOnly = stringsOnly;
56333
+ result.indexFlags = indexFlags;
56329
56334
  return result;
56330
56335
  }
56331
56336
  function createOriginIndexType(type) {
@@ -56333,31 +56338,23 @@ function createTypeChecker(host) {
56333
56338
  result.type = type;
56334
56339
  return result;
56335
56340
  }
56336
- function getIndexTypeForGenericType(type, stringsOnly) {
56337
- return stringsOnly ? type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(
56338
- type,
56339
- /*stringsOnly*/
56340
- true
56341
- )) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(
56342
- type,
56343
- /*stringsOnly*/
56344
- false
56345
- ));
56341
+ function getIndexTypeForGenericType(type, indexFlags) {
56342
+ return indexFlags & 1 /* StringsOnly */ ? type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, 1 /* StringsOnly */)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, 0 /* None */));
56346
56343
  }
56347
- function getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) {
56344
+ function getIndexTypeForMappedType(type, indexFlags) {
56348
56345
  const typeParameter = getTypeParameterFromMappedType(type);
56349
56346
  const constraintType = getConstraintTypeFromMappedType(type);
56350
56347
  const nameType = getNameTypeFromMappedType(type.target || type);
56351
- if (!nameType && !noIndexSignatures) {
56348
+ if (!nameType && !(indexFlags & 2 /* NoIndexSignatures */)) {
56352
56349
  return constraintType;
56353
56350
  }
56354
56351
  const keyTypes = [];
56355
56352
  if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
56356
56353
  if (!isGenericIndexType(constraintType)) {
56357
56354
  const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
56358
- forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, stringsOnly, addMemberForKeyType);
56355
+ forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, !!(indexFlags & 1 /* StringsOnly */), addMemberForKeyType);
56359
56356
  } else {
56360
- return getIndexTypeForGenericType(type, stringsOnly);
56357
+ return getIndexTypeForGenericType(type, indexFlags);
56361
56358
  }
56362
56359
  } else {
56363
56360
  forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
@@ -56365,7 +56362,7 @@ function createTypeChecker(host) {
56365
56362
  if (isGenericIndexType(constraintType)) {
56366
56363
  forEachType(constraintType, addMemberForKeyType);
56367
56364
  }
56368
- const result = noIndexSignatures ? filterType(getUnionType(keyTypes), (t) => !(t.flags & (1 /* Any */ | 4 /* String */))) : getUnionType(keyTypes);
56365
+ const result = indexFlags & 2 /* NoIndexSignatures */ ? filterType(getUnionType(keyTypes), (t) => !(t.flags & (1 /* Any */ | 4 /* String */))) : getUnionType(keyTypes);
56369
56366
  if (result.flags & 1048576 /* Union */ && constraintType.flags & 1048576 /* Union */ && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
56370
56367
  return constraintType;
56371
56368
  }
@@ -56418,19 +56415,15 @@ function createTypeChecker(host) {
56418
56415
  origin
56419
56416
  );
56420
56417
  }
56421
- function isPossiblyReducibleByInstantiation(type) {
56422
- const uniqueFilled = getUniqueLiteralFilledInstantiation(type);
56423
- return getReducedType(uniqueFilled) !== uniqueFilled;
56424
- }
56425
- function shouldDeferIndexType(type) {
56426
- return !!(type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) || type.flags & 1048576 /* Union */ && some(type.types, isPossiblyReducibleByInstantiation) || type.flags & 2097152 /* Intersection */ && maybeTypeOfKind(type, 465829888 /* Instantiable */) && some(type.types, isEmptyAnonymousObjectType));
56418
+ function shouldDeferIndexType(type, indexFlags = 0 /* None */) {
56419
+ return !!(type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) || type.flags & 1048576 /* Union */ && !(indexFlags & 4 /* NoReducibleCheck */) && isGenericReducibleType(type) || type.flags & 2097152 /* Intersection */ && maybeTypeOfKind(type, 465829888 /* Instantiable */) && some(type.types, isEmptyAnonymousObjectType));
56427
56420
  }
56428
- function getIndexType(type, stringsOnly = keyofStringsOnly, noIndexSignatures) {
56421
+ function getIndexType(type, indexFlags = defaultIndexFlags) {
56429
56422
  type = getReducedType(type);
56430
- return shouldDeferIndexType(type) ? getIndexTypeForGenericType(type, stringsOnly) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, stringsOnly, noIndexSignatures))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, stringsOnly, noIndexSignatures))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(
56423
+ return shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(
56431
56424
  type,
56432
- (noIndexSignatures ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (stringsOnly ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */),
56433
- stringsOnly === keyofStringsOnly && !noIndexSignatures
56425
+ (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */),
56426
+ indexFlags === defaultIndexFlags
56434
56427
  );
56435
56428
  }
56436
56429
  function getExtractStringType(type) {
@@ -56970,12 +56963,13 @@ function createTypeChecker(host) {
56970
56963
  if (objectType === wildcardType || indexType === wildcardType) {
56971
56964
  return wildcardType;
56972
56965
  }
56966
+ objectType = getReducedType(objectType);
56973
56967
  if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
56974
56968
  indexType = stringType;
56975
56969
  }
56976
56970
  if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
56977
56971
  accessFlags |= 1 /* IncludeUndefined */;
56978
- if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 197 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
56972
+ if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 197 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)) || isGenericReducibleType(objectType))) {
56979
56973
  if (objectType.flags & 3 /* AnyOrUnknown */) {
56980
56974
  return objectType;
56981
56975
  }
@@ -58161,9 +58155,6 @@ function createTypeChecker(host) {
58161
58155
  }
58162
58156
  return type;
58163
58157
  }
58164
- function getUniqueLiteralFilledInstantiation(type) {
58165
- return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
58166
- }
58167
58158
  function getPermissiveInstantiation(type) {
58168
58159
  return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
58169
58160
  }
@@ -58875,7 +58866,12 @@ function createTypeChecker(host) {
58875
58866
  const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
58876
58867
  const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
58877
58868
  for (let i = 0; i < paramCount; i++) {
58878
- const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
58869
+ const sourceType = i === restIndex ? getRestTypeAtPosition(
58870
+ source,
58871
+ i,
58872
+ /*readonly*/
58873
+ true
58874
+ ) : tryGetTypeAtPosition(source, i);
58879
58875
  const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
58880
58876
  if (sourceType && targetType) {
58881
58877
  const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
@@ -60346,7 +60342,7 @@ function createTypeChecker(host) {
60346
60342
  } else {
60347
60343
  const constraint = getSimplifiedTypeOrConstraint(targetType);
60348
60344
  if (constraint) {
60349
- if (isRelatedTo(source2, getIndexType(constraint, target2.stringsOnly), 2 /* Target */, reportErrors2) === -1 /* True */) {
60345
+ if (isRelatedTo(source2, getIndexType(constraint, target2.indexFlags | 4 /* NoReducibleCheck */), 2 /* Target */, reportErrors2) === -1 /* True */) {
60350
60346
  return -1 /* True */;
60351
60347
  }
60352
60348
  } else if (isGenericMappedType(targetType)) {
@@ -60427,13 +60423,7 @@ function createTypeChecker(host) {
60427
60423
  }
60428
60424
  if (!isGenericMappedType(source2)) {
60429
60425
  const targetKeys = keysRemapped ? getNameTypeFromMappedType(target2) : getConstraintTypeFromMappedType(target2);
60430
- const sourceKeys = getIndexType(
60431
- source2,
60432
- /*stringsOnly*/
60433
- void 0,
60434
- /*noIndexSignatures*/
60435
- true
60436
- );
60426
+ const sourceKeys = getIndexType(source2, 2 /* NoIndexSignatures */);
60437
60427
  const includeOptional = modifiers & 4 /* IncludeOptional */;
60438
60428
  const filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : void 0;
60439
60429
  if (includeOptional ? !(filteredByApplicability.flags & 131072 /* Never */) : isRelatedTo(targetKeys, sourceKeys, 3 /* Both */)) {
@@ -71366,12 +71356,12 @@ function createTypeChecker(host) {
71366
71356
  }
71367
71357
  return void 0;
71368
71358
  }
71369
- function getRestTypeAtPosition(source, pos) {
71359
+ function getRestTypeAtPosition(source, pos, readonly = false) {
71370
71360
  const parameterCount = getParameterCount(source);
71371
71361
  const minArgumentCount = getMinArgumentCount(source);
71372
71362
  const restType = getEffectiveRestType(source);
71373
71363
  if (restType && pos >= parameterCount - 1) {
71374
- return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType));
71364
+ return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType), readonly);
71375
71365
  }
71376
71366
  const types = [];
71377
71367
  const flags = [];
@@ -71389,13 +71379,7 @@ function createTypeChecker(host) {
71389
71379
  names.push(name);
71390
71380
  }
71391
71381
  }
71392
- return createTupleType(
71393
- types,
71394
- flags,
71395
- /*readonly*/
71396
- false,
71397
- length(names) === length(types) ? names : void 0
71398
- );
71382
+ return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
71399
71383
  }
71400
71384
  function getParameterCount(signature) {
71401
71385
  const length2 = signature.parameters.length;
@@ -74673,11 +74657,7 @@ function createTypeChecker(host) {
74673
74657
  }
74674
74658
  const objectType = type.objectType;
74675
74659
  const indexType = type.indexType;
74676
- if (isTypeAssignableTo(indexType, getIndexType(
74677
- objectType,
74678
- /*stringsOnly*/
74679
- false
74680
- ))) {
74660
+ if (isTypeAssignableTo(indexType, getIndexType(objectType, 0 /* None */))) {
74681
74661
  if (accessNode.kind === 210 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
74682
74662
  error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
74683
74663
  }
@@ -81497,7 +81477,8 @@ function createTypeChecker(host) {
81497
81477
  return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
81498
81478
  }
81499
81479
  if (!(node.parent.kind === 261 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
81500
- return grammarErrorOnNode(modifier, Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
81480
+ const message = node.kind === 170 /* PropertyDeclaration */ ? Diagnostics.Abstract_properties_can_only_appear_within_an_abstract_class : Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class;
81481
+ return grammarErrorOnNode(modifier, message);
81501
81482
  }
81502
81483
  if (flags & 32 /* Static */) {
81503
81484
  return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");