|
| 1 | +binaryIntegerLiteral.ts(25,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. |
| 2 | + Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. |
| 3 | +binaryIntegerLiteral.ts(34,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. |
| 4 | + Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. |
| 5 | +binaryIntegerLiteral.ts(40,1): error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. |
| 6 | + Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. |
| 7 | + |
| 8 | + |
| 9 | +==== binaryIntegerLiteral.ts (3 errors) ==== |
| 10 | + var bin1 = 0b11010; |
| 11 | + var bin2 = 0B11010; |
| 12 | + var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; |
| 13 | + var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; |
| 14 | + |
| 15 | + var obj1 = { |
| 16 | + 0b11010: "Hello", |
| 17 | + a: bin1, |
| 18 | + bin1, |
| 19 | + b: 0b11010, |
| 20 | + 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, |
| 21 | + } |
| 22 | + |
| 23 | + var obj2 = { |
| 24 | + 0B11010: "World", |
| 25 | + a: bin2, |
| 26 | + bin2, |
| 27 | + b: 0B11010, |
| 28 | + 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, |
| 29 | + } |
| 30 | + |
| 31 | + obj1[0b11010]; // string |
| 32 | + obj1[26]; // string |
| 33 | + obj1["26"]; // string |
| 34 | + obj1["0b11010"]; // any |
| 35 | + ~~~~~~~~~~~~~~~ |
| 36 | +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. |
| 37 | +!!! error TS7053: Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. |
| 38 | + obj1["a"]; // number |
| 39 | + obj1["b"]; // number |
| 40 | + obj1["bin1"]; // number |
| 41 | + obj1["Infinity"]; // boolean |
| 42 | + |
| 43 | + obj2[0B11010]; // string |
| 44 | + obj2[26]; // string |
| 45 | + obj2["26"]; // string |
| 46 | + obj2["0B11010"]; // any |
| 47 | + ~~~~~~~~~~~~~~~ |
| 48 | +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. |
| 49 | +!!! error TS7053: Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. |
| 50 | + obj2["a"]; // number |
| 51 | + obj2["b"]; // number |
| 52 | + obj2["bin2"]; // number |
| 53 | + obj2[9.671406556917009e+24]; // boolean |
| 54 | + obj2["9.671406556917009e+24"]; // boolean |
| 55 | + obj2["Infinity"]; // any |
| 56 | + ~~~~~~~~~~~~~~~~ |
| 57 | +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. |
| 58 | +!!! error TS7053: Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. |
| 59 | + |
| 60 | + |
0 commit comments