Skip to content

Commit e2c9555

Browse files
committed
Merge pull request microsoft#7188 from Microsoft/standardise-errors-on-not-prefix
Error messages consistently use non- prefix
2 parents a769ba7 + ee8986a commit e2c9555

6 files changed

Lines changed: 18 additions & 18 deletions

File tree

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12206,7 +12206,7 @@ namespace ts {
1220612206
forEach(overloads, o => {
1220712207
const deviation = getEffectiveDeclarationFlags(o, flagsToCheck) ^ canonicalFlags;
1220812208
if (deviation & NodeFlags.Export) {
12209-
error(o.name, Diagnostics.Overload_signatures_must_all_be_exported_or_not_exported);
12209+
error(o.name, Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported);
1221012210
}
1221112211
else if (deviation & NodeFlags.Ambient) {
1221212212
error(o.name, Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);
@@ -12215,7 +12215,7 @@ namespace ts {
1221512215
error(o.name || o, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);
1221612216
}
1221712217
else if (deviation & NodeFlags.Abstract) {
12218-
error(o.name, Diagnostics.Overload_signatures_must_all_be_abstract_or_not_abstract);
12218+
error(o.name, Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);
1221912219
}
1222012220
});
1222112221
}

src/compiler/diagnosticMessages.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@
11511151
"category": "Error",
11521152
"code": 2382
11531153
},
1154-
"Overload signatures must all be exported or not exported.": {
1154+
"Overload signatures must all be exported or non-exported.": {
11551155
"category": "Error",
11561156
"code": 2383
11571157
},
@@ -1635,7 +1635,7 @@
16351635
"category": "Error",
16361636
"code": 2511
16371637
},
1638-
"Overload signatures must all be abstract or not abstract.": {
1638+
"Overload signatures must all be abstract or non-abstract.": {
16391639
"category": "Error",
16401640
"code": 2512
16411641
},

tests/baselines/reference/classAbstractInstantiations2.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
55
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(21,1): error TS2511: Cannot create an instance of the abstract class 'B'.
66
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(26,7): error TS2515: Non-abstract class 'C' does not implement inherited abstract member 'bar' from class 'B'.
77
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(46,5): error TS2391: Function implementation is missing or not immediately following the declaration.
8-
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(46,5): error TS2512: Overload signatures must all be abstract or not abstract.
8+
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(46,5): error TS2512: Overload signatures must all be abstract or non-abstract.
99
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts(50,5): error TS1244: Abstract methods can only appear within an abstract class.
1010

1111

@@ -70,7 +70,7 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
7070
~~~
7171
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
7272
~~~
73-
!!! error TS2512: Overload signatures must all be abstract or not abstract.
73+
!!! error TS2512: Overload signatures must all be abstract or non-abstract.
7474
}
7575

7676
class H { // error -- not declared abstract

tests/baselines/reference/classAbstractOverloads.errors.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractOverloads.ts(7,5): error TS2512: Overload signatures must all be abstract or not abstract.
2-
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractOverloads.ts(10,14): error TS2512: Overload signatures must all be abstract or not abstract.
3-
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractOverloads.ts(12,14): error TS2512: Overload signatures must all be abstract or not abstract.
1+
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractOverloads.ts(7,5): error TS2512: Overload signatures must all be abstract or non-abstract.
2+
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractOverloads.ts(10,14): error TS2512: Overload signatures must all be abstract or non-abstract.
3+
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractOverloads.ts(12,14): error TS2512: Overload signatures must all be abstract or non-abstract.
44
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractOverloads.ts(15,5): error TS2391: Function implementation is missing or not immediately following the declaration.
55
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractOverloads.ts(20,14): error TS2516: All declarations of an abstract method must be consecutive.
66

@@ -14,16 +14,16 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst
1414
abstract bar();
1515
bar();
1616
~~~
17-
!!! error TS2512: Overload signatures must all be abstract or not abstract.
17+
!!! error TS2512: Overload signatures must all be abstract or non-abstract.
1818
abstract bar();
1919

2020
abstract baz();
2121
~~~
22-
!!! error TS2512: Overload signatures must all be abstract or not abstract.
22+
!!! error TS2512: Overload signatures must all be abstract or non-abstract.
2323
baz();
2424
abstract baz();
2525
~~~
26-
!!! error TS2512: Overload signatures must all be abstract or not abstract.
26+
!!! error TS2512: Overload signatures must all be abstract or non-abstract.
2727
baz() {}
2828

2929
qux();

tests/baselines/reference/functionOverloadErrors.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ tests/cases/conformance/functions/functionOverloadErrors.ts(50,25): error TS2304
44
tests/cases/conformance/functions/functionOverloadErrors.ts(51,32): error TS2304: Cannot find name 'window'.
55
tests/cases/conformance/functions/functionOverloadErrors.ts(65,13): error TS2385: Overload signatures must all be public, private or protected.
66
tests/cases/conformance/functions/functionOverloadErrors.ts(68,13): error TS2385: Overload signatures must all be public, private or protected.
7-
tests/cases/conformance/functions/functionOverloadErrors.ts(75,21): error TS2383: Overload signatures must all be exported or not exported.
8-
tests/cases/conformance/functions/functionOverloadErrors.ts(79,14): error TS2383: Overload signatures must all be exported or not exported.
7+
tests/cases/conformance/functions/functionOverloadErrors.ts(75,21): error TS2383: Overload signatures must all be exported or non-exported.
8+
tests/cases/conformance/functions/functionOverloadErrors.ts(79,14): error TS2383: Overload signatures must all be exported or non-exported.
99
tests/cases/conformance/functions/functionOverloadErrors.ts(85,18): error TS2384: Overload signatures must all be ambient or non-ambient.
1010
tests/cases/conformance/functions/functionOverloadErrors.ts(90,18): error TS2384: Overload signatures must all be ambient or non-ambient.
1111
tests/cases/conformance/functions/functionOverloadErrors.ts(94,10): error TS2394: Overload signature is not compatible with function implementation.
@@ -103,13 +103,13 @@ tests/cases/conformance/functions/functionOverloadErrors.ts(116,19): error TS237
103103
module M {
104104
export function fn1();
105105
~~~
106-
!!! error TS2383: Overload signatures must all be exported or not exported.
106+
!!! error TS2383: Overload signatures must all be exported or non-exported.
107107
function fn1(n: string);
108108
function fn1() { }
109109

110110
function fn2(n: string);
111111
~~~
112-
!!! error TS2383: Overload signatures must all be exported or not exported.
112+
!!! error TS2383: Overload signatures must all be exported or non-exported.
113113
export function fn2();
114114
export function fn2() { }
115115
}

tests/baselines/reference/overloadModifiersMustAgree.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
tests/cases/compiler/overloadModifiersMustAgree.ts(2,12): error TS2385: Overload signatures must all be public, private or protected.
22
tests/cases/compiler/overloadModifiersMustAgree.ts(6,18): error TS2384: Overload signatures must all be ambient or non-ambient.
3-
tests/cases/compiler/overloadModifiersMustAgree.ts(7,17): error TS2383: Overload signatures must all be exported or not exported.
3+
tests/cases/compiler/overloadModifiersMustAgree.ts(7,17): error TS2383: Overload signatures must all be exported or non-exported.
44
tests/cases/compiler/overloadModifiersMustAgree.ts(12,5): error TS2386: Overload signatures must all be optional or required.
55

66

@@ -17,7 +17,7 @@ tests/cases/compiler/overloadModifiersMustAgree.ts(12,5): error TS2386: Overload
1717
!!! error TS2384: Overload signatures must all be ambient or non-ambient.
1818
export function bar(s: string);
1919
~~~
20-
!!! error TS2383: Overload signatures must all be exported or not exported.
20+
!!! error TS2383: Overload signatures must all be exported or non-exported.
2121
function bar(s?: string) { }
2222

2323
interface I {

0 commit comments

Comments
 (0)