Change diagnostic
This commit is contained in:
parent
34b9ad5b54
commit
b6b48c2afa
|
@ -25518,7 +25518,7 @@ namespace ts {
|
|||
switch (modifier.kind) {
|
||||
case SyntaxKind.ConstKeyword:
|
||||
if (node.kind !== SyntaxKind.EnumDeclaration) {
|
||||
return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString(SyntaxKind.ConstKeyword));
|
||||
return grammarErrorOnNode(node, Diagnostics._0_modifier_cannot_be_used_here, tokenToString(SyntaxKind.ConstKeyword));
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.PublicKeyword:
|
||||
|
|
|
@ -803,10 +803,6 @@
|
|||
"category": "Error",
|
||||
"code": 1247
|
||||
},
|
||||
"A class member cannot have the '{0}' keyword.": {
|
||||
"category": "Error",
|
||||
"code": 1248
|
||||
},
|
||||
"A decorator can only decorate a method implementation, not an overload.": {
|
||||
"category": "Error",
|
||||
"code": 1249
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace Harness.Parallel.Worker {
|
|||
retries() { return this; },
|
||||
slow() { return this; },
|
||||
timeout(n) {
|
||||
timeout = n;
|
||||
timeout = n as number;
|
||||
return this;
|
||||
},
|
||||
};
|
||||
|
@ -127,7 +127,7 @@ namespace Harness.Parallel.Worker {
|
|||
const fakeContext: Mocha.ITestCallbackContext = {
|
||||
skip() { return this; },
|
||||
timeout(n) {
|
||||
timeout = n;
|
||||
timeout = n as number;
|
||||
return this;
|
||||
},
|
||||
retries() { return this; },
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
tests/cases/compiler/ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts(2,3): error TS1248: A class member cannot have the 'const' keyword.
|
||||
tests/cases/compiler/ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts(2,3): error TS1042: 'const' modifier cannot be used here.
|
||||
|
||||
|
||||
==== tests/cases/compiler/ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts (1 errors) ====
|
||||
class AtomicNumbers {
|
||||
static const H = 1;
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1248: A class member cannot have the 'const' keyword.
|
||||
!!! error TS1042: 'const' modifier cannot be used here.
|
||||
}
|
Loading…
Reference in a new issue