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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(33,13): error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(34,13): error TS1121: Octal literals are not allowed. Use the syntax '-0o1'.
tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(64,13): error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(65,13): error TS1121: Octal literals are not allowed. Use the syntax '-0o1'.
tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(94,13): error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(95,13): error TS1121: Octal literals are not allowed. Use the syntax '-0o1'.
tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(124,13): error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts(125,13): error TS1121: Octal literals are not allowed. Use the syntax '-0o1'.
!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
==== tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts (8 errors) ====
// string named numeric properties are legal and distinct when indexed by string values
// indexed numerically the value is converted to a number
// no errors expected below
class C {
"0.1": void;
".1": Object;
"1": number;
"1.": string;
"1..": boolean;
"1.0": Date;
"-1.0": RegExp;
"-1": Date;
}
var c: C;
var r1 = c['0.1'];
var r2 = c['.1'];
var r3 = c['1'];
var r3 = c[1];
var r4 = c['1.'];
var r3 = c[1.]; // same as indexing by 1 when done numerically
var r5 = c['1..'];
var r6 = c['1.0'];
var r3 = c[1.0]; // same as indexing by 1 when done numerically
// BUG 823822
var r7 = i[-1];
var r7 = i[-1.0];
var r8 = i["-1.0"];
var r9 = i["-1"];
var r10 = i[0x1]
var r11 = i[-0x1]
var r12 = i[01]
~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
var r13 = i[-01]
~~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o1'.
interface I {
"0.1": void;
".1": Object;
"1": number;
"1.": string;
"1..": boolean;
"1.0": Date;
"-1.0": RegExp;
"-1": Date;
}
var i: I;
var r1 = i['0.1'];
var r2 = i['.1'];
var r3 = i['1'];
var r3 = c[1];
var r4 = i['1.'];
var r3 = c[1.]; // same as indexing by 1 when done numerically
var r5 = i['1..'];
var r6 = i['1.0'];
var r3 = c[1.0]; // same as indexing by 1 when done numerically
// BUG 823822
var r7 = i[-1];
var r7 = i[-1.0];
var r8 = i["-1.0"];
var r9 = i["-1"];
var r10 = i[0x1]
var r11 = i[-0x1]
var r12 = i[01]
~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
var r13 = i[-01]
~~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o1'.
var a: {
"0.1": void;
".1": Object;
"1": number;
"1.": string;
"1..": boolean;
"1.0": Date;
"-1.0": RegExp;
"-1": Date;
}
var r1 = a['0.1'];
var r2 = a['.1'];
var r3 = a['1'];
var r3 = c[1];
var r4 = a['1.'];
var r3 = c[1.]; // same as indexing by 1 when done numerically
var r5 = a['1..'];
var r6 = a['1.0'];
var r3 = c[1.0]; // same as indexing by 1 when done numerically
// BUG 823822
var r7 = i[-1];
var r7 = i[-1.0];
var r8 = i["-1.0"];
var r9 = i["-1"];
var r10 = i[0x1]
var r11 = i[-0x1]
var r12 = i[01]
~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
var r13 = i[-01]
~~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o1'.
var b = {
"0.1": <void>null,
".1": new Object(),
"1": 1,
"1.": "",
"1..": true,
"1.0": new Date(),
"-1.0": /123/,
"-1": Date
};
var r1 = b['0.1'];
var r2 = b['.1'];
var r3 = b['1'];
var r3 = c[1];
var r4 = b['1.'];
var r3 = c[1.]; // same as indexing by 1 when done numerically
var r5 = b['1..'];
var r6 = b['1.0'];
var r3 = c[1.0]; // same as indexing by 1 when done numerically
// BUG 823822
var r7 = i[-1];
var r7 = i[-1.0];
var r8 = i["-1.0"];
var r9 = i["-1"];
var r10 = i[0x1]
var r11 = i[-0x1]
var r12 = i[01]
~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '0o1'.
var r13 = i[-01]
~~~
!!! error TS1121: Octal literals are not allowed. Use the syntax '-0o1'.
|