2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(5,5): error TS2374: Duplicate string index signature.
|
|
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(10,5): error TS2374: Duplicate string index signature.
|
|
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(15,5): error TS2374: Duplicate string index signature.
|
|
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(20,5): error TS2374: Duplicate string index signature.
|
|
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(25,5): error TS2374: Duplicate string index signature.
|
|
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(30,5): error TS2374: Duplicate string index signature.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts (6 errors) ====
|
|
|
|
// Multiple indexers of the same type are an error
|
|
|
|
|
|
|
|
class C {
|
|
|
|
[x: string]: string;
|
|
|
|
[x: string]: string;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2374: Duplicate string index signature.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface I {
|
|
|
|
[x: string]: string;
|
|
|
|
[x: string]: string;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2374: Duplicate string index signature.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var a: {
|
|
|
|
[x: string]: string;
|
|
|
|
[x: string]: string;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2374: Duplicate string index signature.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var b: {
|
|
|
|
[x: string]: string;
|
|
|
|
[x: string]: string;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2374: Duplicate string index signature.
|
2014-07-13 01:04:16 +02:00
|
|
|
} = { y: '' }
|
|
|
|
|
|
|
|
class C2<T> {
|
|
|
|
[x: string]: string;
|
|
|
|
[x: string]: string;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2374: Duplicate string index signature.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface I2<T> {
|
|
|
|
[x: string]: string;
|
|
|
|
[x: string]: string;
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2374: Duplicate string index signature.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|