52 lines
No EOL
2 KiB
Text
52 lines
No EOL
2 KiB
Text
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.
|
|
|
|
|
|
==== 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;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2374: Duplicate string index signature.
|
|
}
|
|
|
|
interface I {
|
|
[x: string]: string;
|
|
[x: string]: string;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2374: Duplicate string index signature.
|
|
}
|
|
|
|
var a: {
|
|
[x: string]: string;
|
|
[x: string]: string;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2374: Duplicate string index signature.
|
|
}
|
|
|
|
var b: {
|
|
[x: string]: string;
|
|
[x: string]: string;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2374: Duplicate string index signature.
|
|
} = { y: '' }
|
|
|
|
class C2<T> {
|
|
[x: string]: string;
|
|
[x: string]: string;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2374: Duplicate string index signature.
|
|
}
|
|
|
|
interface I2<T> {
|
|
[x: string]: string;
|
|
[x: string]: string;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2374: Duplicate string index signature.
|
|
} |