Skip to content

Commit 6a6c03b

Browse files
committed
Fix error message wording
1 parent 2d16474 commit 6a6c03b

21 files changed

+45
-45
lines changed

src/compiler/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8999,7 +8999,7 @@ module ts {
89998999
var typeName1 = typeToString(existing.containingType);
90009000
var typeName2 = typeToString(base);
90019001

9002-
var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2);
9002+
var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2);
90039003
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2);
90049004
diagnostics.add(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo));
90059005
}

src/compiler/diagnosticInformationMap.generated.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ module ts {
167167
Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: DiagnosticCategory.Error, key: "Global type '{0}' must be a class or interface type." },
168168
Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." },
169169
Cannot_find_global_type_0: { code: 2318, category: DiagnosticCategory.Error, key: "Cannot find global type '{0}'." },
170-
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." },
170+
Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: DiagnosticCategory.Error, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." },
171171
Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." },
172172
Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." },
173173
Type_0_is_not_assignable_to_type_1: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." },

src/compiler/diagnosticMessages.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@
661661
"category": "Error",
662662
"code": 2318
663663
},
664-
"Named properties '{0}' of types '{1}' and '{2}' are not identical.": {
664+
"Named property '{0}' of types '{1}' and '{2}' are not identical.": {
665665
"category": "Error",
666666
"code": 2319
667667
},

tests/baselines/reference/baseTypePrivateMemberClash.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'.
2-
Named properties 'm' of types 'X' and 'Y' are not identical.
2+
Named property 'm' of types 'X' and 'Y' are not identical.
33

44

55
==== tests/cases/compiler/baseTypePrivateMemberClash.ts (1 errors) ====
@@ -13,4 +13,4 @@ tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interfac
1313
interface Z extends X, Y { }
1414
~
1515
!!! error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'.
16-
!!! error TS2320: Named properties 'm' of types 'X' and 'Y' are not identical.
16+
!!! error TS2320: Named property 'm' of types 'X' and 'Y' are not identical.

tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I<number>' and 'I<string>'.
2-
Named properties 'foo' of types 'I<number>' and 'I<string>' are not identical.
2+
Named property 'foo' of types 'I<number>' and 'I<string>' are not identical.
33
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(13,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
44

55

@@ -14,7 +14,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesTha
1414
interface A extends I<number>, I<string> { }
1515
~
1616
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'I<number>' and 'I<string>'.
17-
!!! error TS2320: Named properties 'foo' of types 'I<number>' and 'I<string>' are not identical.
17+
!!! error TS2320: Named property 'foo' of types 'I<number>' and 'I<string>' are not identical.
1818

1919
var x: A;
2020
// BUG 822524

tests/baselines/reference/conflictingMemberTypesInBases.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'.
2-
Named properties 'm' of types 'B' and 'D' are not identical.
2+
Named property 'm' of types 'B' and 'D' are not identical.
33

44

55
==== tests/cases/compiler/conflictingMemberTypesInBases.ts (1 errors) ====
@@ -17,6 +17,6 @@ tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Inte
1717
interface E extends B { } // Error here for extending B and D
1818
~
1919
!!! error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'.
20-
!!! error TS2320: Named properties 'm' of types 'B' and 'D' are not identical.
20+
!!! error TS2320: Named property 'm' of types 'B' and 'D' are not identical.
2121
interface E extends D { } // No duplicate error here
2222

tests/baselines/reference/genericAndNonGenericInheritedSignature1.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/compiler/genericAndNonGenericInheritedSignature1.ts(7,11): error TS2320: Interface 'Hello' cannot simultaneously extend types 'Foo' and 'Bar'.
2-
Named properties 'f' of types 'Foo' and 'Bar' are not identical.
2+
Named property 'f' of types 'Foo' and 'Bar' are not identical.
33

44

55
==== tests/cases/compiler/genericAndNonGenericInheritedSignature1.ts (1 errors) ====
@@ -12,6 +12,6 @@ tests/cases/compiler/genericAndNonGenericInheritedSignature1.ts(7,11): error TS2
1212
interface Hello extends Foo, Bar {
1313
~~~~~
1414
!!! error TS2320: Interface 'Hello' cannot simultaneously extend types 'Foo' and 'Bar'.
15-
!!! error TS2320: Named properties 'f' of types 'Foo' and 'Bar' are not identical.
15+
!!! error TS2320: Named property 'f' of types 'Foo' and 'Bar' are not identical.
1616
}
1717

tests/baselines/reference/genericAndNonGenericInheritedSignature2.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/compiler/genericAndNonGenericInheritedSignature2.ts(7,11): error TS2320: Interface 'Hello' cannot simultaneously extend types 'Bar' and 'Foo'.
2-
Named properties 'f' of types 'Bar' and 'Foo' are not identical.
2+
Named property 'f' of types 'Bar' and 'Foo' are not identical.
33

44

55
==== tests/cases/compiler/genericAndNonGenericInheritedSignature2.ts (1 errors) ====
@@ -12,6 +12,6 @@ tests/cases/compiler/genericAndNonGenericInheritedSignature2.ts(7,11): error TS2
1212
interface Hello extends Bar, Foo {
1313
~~~~~
1414
!!! error TS2320: Interface 'Hello' cannot simultaneously extend types 'Bar' and 'Foo'.
15-
!!! error TS2320: Named properties 'f' of types 'Bar' and 'Foo' are not identical.
15+
!!! error TS2320: Named property 'f' of types 'Bar' and 'Foo' are not identical.
1616
}
1717

tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
2-
Named properties 'x' of types 'C' and 'C2' are not identical.
2+
Named property 'x' of types 'C' and 'C2' are not identical.
33

44

55
==== tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts (1 errors) ====
@@ -14,6 +14,6 @@ tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts(9,1
1414
interface A extends C, C2 { // error
1515
~
1616
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
17-
!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical.
17+
!!! error TS2320: Named property 'x' of types 'C' and 'C2' are not identical.
1818
y: string;
1919
}

tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
2-
Named properties 'x' of types 'C' and 'C2' are not identical.
2+
Named property 'x' of types 'C' and 'C2' are not identical.
33

44

55
==== tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts (1 errors) ====
@@ -14,6 +14,6 @@ tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts(9,11):
1414
interface A extends C, C2 { // error
1515
~
1616
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
17-
!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical.
17+
!!! error TS2320: Named property 'x' of types 'C' and 'C2' are not identical.
1818
y: string;
1919
}

tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
2-
Named properties 'x' of types 'C' and 'C2' are not identical.
2+
Named property 'x' of types 'C' and 'C2' are not identical.
33

44

55
==== tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts (1 errors) ====
@@ -14,6 +14,6 @@ tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts(9,11):
1414
interface A extends C, C2 { // error
1515
~
1616
!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'.
17-
!!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical.
17+
!!! error TS2320: Named property 'x' of types 'C' and 'C2' are not identical.
1818
y: string;
1919
}

tests/baselines/reference/interfaceDeclaration1.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(35,7): error TS2420: Class 'C1' in
77
Property 'prototype' is missing in type 'C1'.
88
tests/cases/compiler/interfaceDeclaration1.ts(41,11): error TS2310: Type 'i8' recursively references itself as a base type.
99
tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11'.
10-
Named properties 'foo' of types 'i10' and 'i11' are not identical.
10+
Named property 'foo' of types 'i10' and 'i11' are not identical.
1111

1212

1313
==== tests/cases/compiler/interfaceDeclaration1.ts (8 errors) ====
@@ -80,5 +80,5 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i
8080
interface i12 extends i10, i11 { }
8181
~~~
8282
!!! error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11'.
83-
!!! error TS2320: Named properties 'foo' of types 'i10' and 'i11' are not identical.
83+
!!! error TS2320: Named property 'foo' of types 'i10' and 'i11' are not identical.
8484

tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
2-
Named properties 'x' of types 'Foo' and 'Bar' are not identical.
2+
Named property 'x' of types 'Foo' and 'Bar' are not identical.
33
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'.
44
Property 'x' is private in type 'Bar' but not in type 'I4'.
55
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'.
@@ -20,7 +20,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending
2020
interface I3 extends Foo, Bar { // error
2121
~~
2222
!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
23-
!!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical.
23+
!!! error TS2320: Named property 'x' of types 'Foo' and 'Bar' are not identical.
2424
}
2525

2626
interface I4 extends Foo, Bar { // error

tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
2-
Named properties 'x' of types 'Foo' and 'Bar' are not identical.
2+
Named property 'x' of types 'Foo' and 'Bar' are not identical.
33
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'.
44
Property 'x' is protected but type 'I4' is not a class derived from 'Bar'.
55
tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'.
@@ -20,7 +20,7 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending
2020
interface I3 extends Foo, Bar { // error
2121
~~
2222
!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'.
23-
!!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical.
23+
!!! error TS2320: Named property 'x' of types 'Foo' and 'Bar' are not identical.
2424
}
2525

2626
interface I4 extends Foo, Bar { // error

tests/baselines/reference/interfaceImplementation7.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/compiler/interfaceImplementation7.ts(4,11): error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'.
2-
Named properties 'name' of types 'i1' and 'i2' are not identical.
2+
Named property 'name' of types 'i1' and 'i2' are not identical.
33
tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' incorrectly implements interface 'i4'.
44
Types of property 'name' are incompatible.
55
Type '() => string' is not assignable to type '() => { s: string; n: number; }'.
@@ -14,7 +14,7 @@ tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1'
1414
interface i3 extends i1, i2 { }
1515
~~
1616
!!! error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'.
17-
!!! error TS2320: Named properties 'name' of types 'i1' and 'i2' are not identical.
17+
!!! error TS2320: Named property 'name' of types 'i1' and 'i2' are not identical.
1818
interface i4 extends i1, i2 { name(): { s: string; n: number; }; }
1919

2020
class C1 implements i4 {

tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tests/cases/compiler/interfacePropertiesWithSameName2.ts(10,11): error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker'.
2-
Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical.
2+
Named property 'getStatus' of types 'Mover' and 'Shaker' are not identical.
33
tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker'.
4-
Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical.
4+
Named property 'getStatus' of types 'Mover' and 'Shaker' are not identical.
55

66

77
==== tests/cases/compiler/interfacePropertiesWithSameName2.ts (2 errors) ====
@@ -17,7 +17,7 @@ tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: I
1717
interface MoverShaker extends Mover, Shaker {
1818
~~~~~~~~~~~
1919
!!! error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker'.
20-
!!! error TS2320: Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical.
20+
!!! error TS2320: Named property 'getStatus' of types 'Mover' and 'Shaker' are not identical.
2121

2222
}
2323

@@ -36,7 +36,7 @@ tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: I
3636
interface MoverShaker2 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { } // error
3737
~~~~~~~~~~~~
3838
!!! error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker'.
39-
!!! error TS2320: Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical.
39+
!!! error TS2320: Named property 'getStatus' of types 'Mover' and 'Shaker' are not identical.
4040

4141
interface MoverShaker3 extends MoversAndShakers.Mover, MoversAndShakers.Shaker {
4242
getStatus(): { speed: number; frequency: number; }; // ok because this getStatus overrides the conflicting ones above
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tests/cases/compiler/interfacePropertiesWithSameName3.ts(3,11): error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D'.
2-
Named properties 'a' of types 'E' and 'D' are not identical.
2+
Named property 'a' of types 'E' and 'D' are not identical.
33
tests/cases/compiler/interfacePropertiesWithSameName3.ts(7,11): error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2'.
4-
Named properties 'a' of types 'E2' and 'D2' are not identical.
4+
Named property 'a' of types 'E2' and 'D2' are not identical.
55

66

77
==== tests/cases/compiler/interfacePropertiesWithSameName3.ts (2 errors) ====
@@ -10,12 +10,12 @@ tests/cases/compiler/interfacePropertiesWithSameName3.ts(7,11): error TS2320: In
1010
interface F extends E, D { } // error
1111
~
1212
!!! error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D'.
13-
!!! error TS2320: Named properties 'a' of types 'E' and 'D' are not identical.
13+
!!! error TS2320: Named property 'a' of types 'E' and 'D' are not identical.
1414

1515
class D2 { a: number; }
1616
class E2 { a: string; }
1717
interface F2 extends E2, D2 { } // error
1818
~~
1919
!!! error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2'.
20-
!!! error TS2320: Named properties 'a' of types 'E2' and 'D2' are not identical.
20+
!!! error TS2320: Named property 'a' of types 'E2' and 'D2' are not identical.
2121

tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa
44
Types of property 'b' are incompatible.
55
Type 'number' is not assignable to type 'string'.
66
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(52,15): error TS2320: Interface 'Derived3<T>' cannot simultaneously extend types 'Base1<number>' and 'Base2<number>'.
7-
Named properties 'x' of types 'Base1<number>' and 'Base2<number>' are not identical.
7+
Named property 'x' of types 'Base1<number>' and 'Base2<number>' are not identical.
88
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2430: Interface 'Derived4<T>' incorrectly extends interface 'Base1<number>'.
99
Types of property 'x' are incompatible.
1010
Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }'.
@@ -86,7 +86,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa
8686
interface Derived3<T> extends Base1<number>, Base2<number> { } // error
8787
~~~~~~~~
8888
!!! error TS2320: Interface 'Derived3<T>' cannot simultaneously extend types 'Base1<number>' and 'Base2<number>'.
89-
!!! error TS2320: Named properties 'x' of types 'Base1<number>' and 'Base2<number>' are not identical.
89+
!!! error TS2320: Named property 'x' of types 'Base1<number>' and 'Base2<number>' are not identical.
9090

9191
interface Derived4<T> extends Base1<number>, Base2<number> { // error
9292
~~~~~~~~

0 commit comments

Comments
 (0)