Skip to content

Commit

Permalink
Don't pass prop.name directly for error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
JsonFreeman committed Feb 7, 2015
1 parent 6a6c03b commit 92617f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8999,7 +8999,7 @@ module ts {
var typeName1 = typeToString(existing.containingType);
var typeName2 = typeToString(base);

var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2);
var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, symbolToString(prop), typeName1, typeName2);
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2);
diagnostics.add(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo));
}
Expand Down
16 changes: 16 additions & 0 deletions tests/baselines/reference/symbolProperty35.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
tests/cases/conformance/es6/Symbols/symbolProperty35.ts(8,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'I1' and 'I2'.
Named property '[Symbol.toStringTag]' of types 'I1' and 'I2' are not identical.


==== tests/cases/conformance/es6/Symbols/symbolProperty35.ts (1 errors) ====
interface I1 {
[Symbol.toStringTag](): { x: string }
}
interface I2 {
[Symbol.toStringTag](): { x: number }
}

interface I3 extends I1, I2 { }
~~
!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'I1' and 'I2'.
!!! error TS2320: Named property '[Symbol.toStringTag]' of types 'I1' and 'I2' are not identical.

This comment has been minimized.

Copy link
@yuit

yuit Feb 10, 2015

Contributor

Minor: I don't think we need square bracket

This comment has been minimized.

Copy link
@JsonFreeman

JsonFreeman Feb 10, 2015

Author Contributor

Probably don't need it. I do like it better though. It feels more like a computed property.

0 comments on commit 92617f5

Please sign in to comment.