59 lines
2.6 KiB
Plaintext
59 lines
2.6 KiB
Plaintext
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(5,5): error TS2375: Duplicate number index signature.
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(10,5): error TS2375: Duplicate number index signature.
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(15,5): error TS2375: Duplicate number index signature.
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(20,5): error TS2375: Duplicate number index signature.
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(25,5): error TS2375: Duplicate number index signature.
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(28,11): error TS2428: All declarations of an interface must have identical type parameters.
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(29,5): error TS2375: Duplicate number index signature.
|
|
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts(30,5): error TS2375: Duplicate number index signature.
|
|
|
|
|
|
==== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/multipleNumericIndexers.ts (8 errors) ====
|
|
// Multiple indexers of the same type are an error
|
|
|
|
class C {
|
|
[x: number]: string;
|
|
[x: number]: string;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2375: Duplicate number index signature.
|
|
}
|
|
|
|
interface I {
|
|
[x: number]: string;
|
|
[x: number]: string;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2375: Duplicate number index signature.
|
|
}
|
|
|
|
var a: {
|
|
[x: number]: string;
|
|
[x: number]: string;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2375: Duplicate number index signature.
|
|
}
|
|
|
|
var b: {
|
|
[x: number]: string;
|
|
[x: number]: string
|
|
~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2375: Duplicate number index signature.
|
|
} = { 1: '', "2": '' }
|
|
|
|
class C2<T> {
|
|
[x: number]: string;
|
|
[x: number]: string;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2375: Duplicate number index signature.
|
|
}
|
|
|
|
interface I<T> {
|
|
~
|
|
!!! error TS2428: All declarations of an interface must have identical type parameters.
|
|
[x: number]: string;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2375: Duplicate number index signature.
|
|
[x: number]: string;
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2375: Duplicate number index signature.
|
|
}
|
|
|