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 71 72 73 74 75 76 77
|
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(6,5): error TS2300: Duplicate identifier '1.0'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(7,5): error TS2300: Duplicate identifier '1.'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(8,5): error TS2300: Duplicate identifier '1.00'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(12,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(13,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(14,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(15,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(19,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(20,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(21,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(22,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(27,5): error TS1117: An object literal cannot have multiple properties with the same name.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(28,5): error TS1117: An object literal cannot have multiple properties with the same name.
tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts(29,5): error TS1117: An object literal cannot have multiple properties with the same name.
==== tests/cases/conformance/types/members/objectTypeWithDuplicateNumericProperty.ts (14 errors) ====
// numeric properties must be distinct after a ToNumber operation
// so the below are all errors
class C {
1;
1.0;
~~~
!!! error TS2300: Duplicate identifier '1.0'.
1.;
~~
!!! error TS2300: Duplicate identifier '1.'.
1.00;
~~~~
!!! error TS2300: Duplicate identifier '1.00'.
}
interface I {
1;
~
!!! error TS2300: Duplicate identifier '1'.
1.0;
~~~
!!! error TS2300: Duplicate identifier '1'.
1.;
~~
!!! error TS2300: Duplicate identifier '1'.
1.00;
~~~~
!!! error TS2300: Duplicate identifier '1'.
}
var a: {
1;
~
!!! error TS2300: Duplicate identifier '1'.
1.0;
~~~
!!! error TS2300: Duplicate identifier '1'.
1.;
~~
!!! error TS2300: Duplicate identifier '1'.
1.00;
~~~~
!!! error TS2300: Duplicate identifier '1'.
}
var b = {
1: 1,
1.0: 1,
~~~
!!! error TS1117: An object literal cannot have multiple properties with the same name.
1.: 1,
~~
!!! error TS1117: An object literal cannot have multiple properties with the same name.
1.00: 1
~~~~
!!! error TS1117: An object literal cannot have multiple properties with the same name.
}
|