1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(4,5): error TS2374: Duplicate index signature for type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(5,5): error TS2374: Duplicate index signature for type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(9,5): error TS2374: Duplicate index signature for type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(10,5): error TS2374: Duplicate index signature for type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(14,5): error TS2374: Duplicate index signature for type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(15,5): error TS2374: Duplicate index signature for type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(19,5): error TS2374: Duplicate index signature for type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(20,5): error TS2374: Duplicate index signature for type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(24,5): error TS2374: Duplicate index signature for type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(25,5): error TS2374: Duplicate index signature for type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(29,5): error TS2374: Duplicate index signature for type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts(30,5): error TS2374: Duplicate index signature for type 'string'.
==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleStringIndexers.ts (12 errors) ====
// Multiple indexers of the same type are an error
class C {
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
}
interface I {
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
}
var a: {
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
}
var b: {
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
} = { y: '' }
class C2<T> {
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
}
interface I2<T> {
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! error TS2374: Duplicate index signature for type 'string'.
}
|