Skip to content

Commit 356622c

Browse files
Merge pull request #1067 from Microsoft/deduplicateTypeNotAssignableMessage
Removed duplicate diagnostic message.
2 parents fff8ef8 + e12e31b commit 356622c

File tree

278 files changed

+2658
-2662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+2658
-2662
lines changed

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ module ts {
144144
Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: DiagnosticCategory.Error, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." },
145145
Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." },
146146
Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." },
147-
Type_0_is_not_assignable_to_type_1: { code: 2323, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." },
147+
Type_0_is_not_assignable_to_type_1: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." },
148148
Property_0_is_missing_in_type_1: { code: 2324, category: DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." },
149149
Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: DiagnosticCategory.Error, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." },
150150
Types_of_property_0_are_incompatible: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible." },

src/compiler/diagnosticMessages.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,6 @@
572572
"category": "Error",
573573
"code": 2322
574574
},
575-
"Type '{0}' is not assignable to type '{1}'.": {
576-
"category": "Error",
577-
"code": 2323
578-
},
579575
"Property '{0}' is missing in type '{1}'.": {
580576
"category": "Error",
581577
"code": 2324

tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(8,16): error TS10
66
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
77
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
88
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
9-
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2323: Type 'string' is not assignable to type 'number'.
10-
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2323: Type 'string' is not assignable to type 'number'.
11-
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2323: Type 'number' is not assignable to type 'string'.
12-
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2323: Type 'number' is not assignable to type 'string'.
9+
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2322: Type 'string' is not assignable to type 'number'.
10+
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2322: Type 'string' is not assignable to type 'number'.
11+
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2322: Type 'number' is not assignable to type 'string'.
12+
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2322: Type 'number' is not assignable to type 'string'.
1313

1414

1515
==== tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts (12 errors) ====
@@ -21,13 +21,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2
2121
~~~~~~~~~~~~~~~~~~~~~~~~~~~
2222
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2323
~~
24-
!!! error TS2323: Type 'string' is not assignable to type 'number'.
24+
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2525

2626
public get AnnotatedSetter_SetterLast() { return ""; }
2727
~~~~~~~~~~~~~~~~~~~~~~~~~~
2828
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2929
~~
30-
!!! error TS2323: Type 'string' is not assignable to type 'number'.
30+
!!! error TS2322: Type 'string' is not assignable to type 'number'.
3131
public set AnnotatedSetter_SetterLast(a: number) { }
3232
~~~~~~~~~~~~~~~~~~~~~~~~~~
3333
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -39,13 +39,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2
3939
~~~~~~~~~~~~~~~~~~~~~~~~~~~
4040
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
4141
~~~~
42-
!!! error TS2323: Type 'number' is not assignable to type 'string'.
42+
!!! error TS2322: Type 'number' is not assignable to type 'string'.
4343

4444
public set AnnotatedGetter_GetterLast(aStr) { aStr = 0; }
4545
~~~~~~~~~~~~~~~~~~~~~~~~~~
4646
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
4747
~~~~
48-
!!! error TS2323: Type 'number' is not assignable to type 'string'.
48+
!!! error TS2322: Type 'number' is not assignable to type 'string'.
4949
public get AnnotatedGetter_GetterLast(): string { return ""; }
5050
~~~~~~~~~~~~~~~~~~~~~~~~~~
5151
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.

tests/baselines/reference/aliasAssignments.errors.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2323: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
1+
tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
22
Property 'someClass' is missing in type 'Number'.
3-
tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2323: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'.
3+
tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'.
44

55

66
==== tests/cases/compiler/aliasAssignments_1.ts (2 errors) ====
77
import moduleA = require("aliasAssignments_moduleA");
88
var x = moduleA;
99
x = 1; // Should be error
1010
~
11-
!!! error TS2323: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
12-
!!! error TS2323: Property 'someClass' is missing in type 'Number'.
11+
!!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
12+
!!! error TS2322: Property 'someClass' is missing in type 'Number'.
1313
var y = 1;
1414
y = moduleA; // should be error
1515
~
16-
!!! error TS2323: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'.
16+
!!! error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'.
1717

1818
==== tests/cases/compiler/aliasAssignments_moduleA.ts (0 errors) ====
1919
export class someClass {
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tests/cases/compiler/ambiguousOverload.ts(5,5): error TS2323: Type 'number' is not assignable to type 'string'.
2-
tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2323: Type 'string' is not assignable to type 'number'.
1+
tests/cases/compiler/ambiguousOverload.ts(5,5): error TS2322: Type 'number' is not assignable to type 'string'.
2+
tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2322: Type 'string' is not assignable to type 'number'.
33

44

55
==== tests/cases/compiler/ambiguousOverload.ts (2 errors) ====
@@ -9,12 +9,12 @@ tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2323: Type 'string' is
99
var x: number = foof("s", null);
1010
var y: string = foof("s", null);
1111
~
12-
!!! error TS2323: Type 'number' is not assignable to type 'string'.
12+
!!! error TS2322: Type 'number' is not assignable to type 'string'.
1313

1414
function foof2(bar: string, x): string;
1515
function foof2(bar: string, y): number;
1616
function foof2(bar: any): any { return bar };
1717
var x2: string = foof2("s", null);
1818
var y2: number = foof2("s", null);
1919
~~
20-
!!! error TS2323: Type 'string' is not assignable to type 'number'.
20+
!!! error TS2322: Type 'string' is not assignable to type 'number'.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2323: Type 'number' is not assignable to type 'IArguments'.
1+
tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments'.
22
Property 'length' is missing in type 'Number'.
33

44

@@ -7,6 +7,6 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS
77
function foo(a) {
88
arguments = 10; /// This shouldnt be of type number and result in error.
99
~~~~~~~~~
10-
!!! error TS2323: Type 'number' is not assignable to type 'IArguments'.
11-
!!! error TS2323: Property 'length' is missing in type 'Number'.
10+
!!! error TS2322: Type 'number' is not assignable to type 'IArguments'.
11+
!!! error TS2322: Property 'length' is missing in type 'Number'.
1212
}

0 commit comments

Comments
 (0)