8000 Prepend 'the' to a couple of ambiguous messages. · icssjs/TypeScript@9e5fba6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e5fba6

Browse files
committed
Prepend 'the' to a couple of ambiguous messages.
Based on feedback from @DanielRosenwasser @Arnavion and @RichiCoder1
1 parent 4197a30 commit 9e5fba6

File tree

4 files changed

+40
-40
lines changed

4 files changed

+40
-40
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5480,7 +5480,7 @@ namespace ts {
54805480
|| compareTypes(target.thisType, source.thisType, reportErrors);
54815481
if (!related) {
54825482
if (reportErrors) {
5483-
errorReporter(Diagnostics.this_types_of_each_signature_are_incompatible);
5483+
errorReporter(Diagnostics.The_this_types_of_each_signature_are_incompatible);
54845484
}
54855485
return Ternary.False;
54865486
}
@@ -10223,7 +10223,7 @@ namespace ts {
1022310223
const thisArgumentNode = getThisArgumentOfCall(node);
1022410224
const thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType;
1022510225
const errorNode = reportErrors ? (thisArgumentNode || node) : undefined;
10226-
const headMessage = Diagnostics.this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;
10226+
const headMessage = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;
1022710227
if (!checkTypeRelatedTo(thisArgumentType, signature.thisType, relation, errorNode, headMessage)) {
1022810228
return false;
1022910229
}

src/compiler/diagnosticMessages.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,11 +1899,11 @@
18991899
"category": "Error",
19001900
"code": 2683
19011901
},
1902-
"'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'.": {
1902+
"The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'.": {
19031903
"category": "Error",
19041904
"code": 2684
19051905
},
1906-
"'this' types of each signature are incompatible.": {
1906+
"The 'this' types of each signature are incompatible.": {
19071907
"category": "Error",
19081908
"code": 2685
19091909
},

tests/baselines/reference/looseThisTypeInFunctions.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(21,1): error TS2322: Type '(this: C, m: number) => number' is not assignable to type '(this: void, m: number) => number'.
2-
'this' types of each signature are incompatible.
2+
The 'this' types of each signature are incompatible.
33
Type 'void' is not assignable to type 'C'.
44
tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(33,28): error TS2339: Property 'length' does not exist on type 'number'.
5-
tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(37,9): error TS2684: 'this' context of type 'void' is not assignable to method's 'this' of type 'I'.
5+
tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(37,9): error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'I'.
66
tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(46,20): error TS2339: Property 'length' does not exist on type 'number'.
77

88

@@ -30,7 +30,7 @@ tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(46,20): error
3030
c.explicitVoid = c.explicitThis; // error, 'void' is missing everything
3131
~~~~~~~~~~~~~~
3232
!!! error TS2322: Type '(this: C, m: number) => number' is not assignable to type '(this: void, m: number) => number'.
33-
!!! error TS2322: 'this' types of each signature are incompatible.
33+
!!! error TS2322: The 'this' types of each signature are incompatible.
3434
!!! error TS2322: Type 'void' is not assignable to type 'C'.
3535
let o = {
3636
n: 101,
@@ -51,7 +51,7 @@ tests/cases/conformance/types/thisType/looseThisTypeInFunctions.ts(46,20): error
5151
let x = i.explicitThis;
5252
let n = x(12); // callee:void doesn't match this:I
5353
~~~~~
54-
!!! error TS2684: 'this' context of type 'void' is not assignable to method's 'this' of type 'I'.
54+
!!! error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'I'.
5555
let u: Unused;
5656
let y = u.implicitNoThis;
5757
n = y(12); // ok, callee:void matches this:any

0 commit comments

Comments
 (0)
0