2014-08-12 00:35:15 +02:00
|
|
|
==== tests/cases/conformance/types/members/duplicateStringIndexers.ts (6 errors) ====
|
2014-07-13 01:04:16 +02:00
|
|
|
// it is an error to have duplicate index signatures of the same kind in a type
|
|
|
|
|
2014-08-12 00:35:15 +02:00
|
|
|
module test {
|
|
|
|
interface Number {
|
|
|
|
[x: string]: string;
|
|
|
|
[x: string]: string;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2014-07-13 01:04:16 +02:00
|
|
|
!!! Duplicate string index signature.
|
2014-08-12 00:35:15 +02:00
|
|
|
}
|
2014-07-13 01:04:16 +02:00
|
|
|
|
2014-08-12 00:35:15 +02:00
|
|
|
interface String {
|
|
|
|
[x: string]: string;
|
|
|
|
[x: string]: string;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2014-07-13 01:04:16 +02:00
|
|
|
!!! Duplicate string index signature.
|
2014-08-12 00:35:15 +02:00
|
|
|
}
|
2014-07-13 01:04:16 +02:00
|
|
|
|
2014-08-12 00:35:15 +02:00
|
|
|
interface Array<T> {
|
|
|
|
[x: string]: T;
|
|
|
|
[x: string]: T;
|
|
|
|
~~~~~~~~~~~~~~~
|
2014-07-13 01:04:16 +02:00
|
|
|
!!! Duplicate string index signature.
|
2014-08-12 00:35:15 +02:00
|
|
|
}
|
2014-07-13 01:04:16 +02:00
|
|
|
|
2014-08-12 00:35:15 +02:00
|
|
|
class C {
|
|
|
|
[x: string]: string;
|
|
|
|
[x: string]: string;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2014-07-13 01:04:16 +02:00
|
|
|
!!! Duplicate string index signature.
|
2014-08-12 00:35:15 +02:00
|
|
|
}
|
2014-07-13 01:04:16 +02:00
|
|
|
|
2014-08-12 00:35:15 +02:00
|
|
|
interface I {
|
|
|
|
[x: string]: string;
|
|
|
|
[x: string]: string;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2014-07-13 01:04:16 +02:00
|
|
|
!!! Duplicate string index signature.
|
2014-08-12 00:35:15 +02:00
|
|
|
}
|
2014-07-13 01:04:16 +02:00
|
|
|
|
2014-08-12 00:35:15 +02:00
|
|
|
var a: {
|
|
|
|
[x: string]: string;
|
|
|
|
[x: string]: string;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2014-07-13 01:04:16 +02:00
|
|
|
!!! Duplicate string index signature.
|
2014-08-12 00:35:15 +02:00
|
|
|
}
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|