Skip to content

Commit 92617f5

Browse files
committed
Don't pass prop.name directly for error reporting
1 parent 6a6c03b commit 92617f5

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
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_property_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, symbolToString(prop), 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
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
tests/cases/conformance/es6/Symbols/symbolProperty35.ts(8,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'I1' and 'I2'.
2+
Named property '[Symbol.toStringTag]' of types 'I1' and 'I2' are not identical.
3+
4+
5+
==== tests/cases/conformance/es6/Symbols/symbolProperty35.ts (1 errors) ====
6+
interface I1 {
7+
[Symbol.toStringTag](): { x: string }
8+
}
9+
interface I2 {
10+
[Symbol.toStringTag](): { x: number }
11+
}
12+
13+
interface I3 extends I1, I2 { }
14+
~~
15+
!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'I1' and 'I2'.
16+
!!! error TS2320: Named property '[Symbol.toStringTag]' of types 'I1' and 'I2' are not identical.

0 commit comments

Comments
 (0)