|
| 1 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(13,12): error TS2493: Tuple type '[string, number]' with length '2' cannot be assigned to tuple with length '3'. |
| 2 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(14,12): error TS2460: Type 'StrNum' has no property '2'. |
| 3 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(15,5): error TS2461: Type '{ 0: string; 1: number; }' is not an array type. |
| 4 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(16,5): error TS2322: Type '[string, number]' is not assignable to type '[number, number, number]'. |
| 5 | + Types of property '0' are incompatible. |
| 6 | + Type 'string' is not assignable to type 'number'. |
| 7 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(17,5): error TS2322: Type 'StrNum' is not assignable to type '[number, number, number]'. |
| 8 | + Types of property '0' are incompatible. |
| 9 | + Type 'string' is not assignable to type 'number'. |
| 10 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(18,5): error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[number, number, number]'. |
| 11 | + Types of property '0' are incompatible. |
| 12 | + Type 'string' is not assignable to type 'number'. |
| 13 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(19,5): error TS2322: Type '[string, number]' is not assignable to type '[string, number, number]'. |
| 14 | + Property '2' is missing in type '[string, number]'. |
| 15 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(20,5): error TS2322: Type 'StrNum' is not assignable to type '[string, number, number]'. |
| 16 | + Property '2' is missing in type 'StrNum'. |
| 17 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(21,5): error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[string, number, number]'. |
| 18 | + Property '2' is missing in type '{ 0: string; 1: number; }'. |
| 19 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(22,5): error TS2322: Type '[string, number]' is not assignable to type '[number]'. |
| 20 | + Types of property '0' are incompatible. |
| 21 | + Type 'string' is not assignable to type 'number'. |
| 22 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(23,5): error TS2322: Type 'StrNum' is not assignable to type '[number]'. |
| 23 | + Types of property '0' are incompatible. |
| 24 | + Type 'string' is not assignable to type 'number'. |
| 25 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(24,5): error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[number]'. |
| 26 | + Types of property '0' are incompatible. |
| 27 | + Type 'string' is not assignable to type 'number'. |
| 28 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(25,5): error TS2322: Type '[string, number]' is not assignable to type '[string]'. |
| 29 | + Types of property 'pop' are incompatible. |
| 30 | + Type '() => string | number' is not assignable to type '() => string'. |
| 31 | + Type 'string | number' is not assignable to type 'string'. |
| 32 | + Type 'number' is not assignable to type 'string'. |
| 33 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(26,5): error TS2322: Type 'StrNum' is not assignable to type '[string]'. |
| 34 | + Types of property 'pop' are incompatible. |
| 35 | + Type '() => string | number' is not assignable to type '() => string'. |
| 36 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(27,5): error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[string]'. |
| 37 | + Property 'length' is missing in type '{ 0: string; 1: number; }'. |
| 38 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(28,5): error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. |
| 39 | + Types of property '0' are incompatible. |
| 40 | + Type 'string' is not assignable to type 'number'. |
| 41 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(29,5): error TS2322: Type 'StrNum' is not assignable to type '[number, string]'. |
| 42 | + Types of property '0' are incompatible. |
| 43 | + Type 'string' is not assignable to type 'number'. |
| 44 | +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(30,5): error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[number, string]'. |
| 45 | + Types of property '0' are incompatible. |
| 46 | + Type 'string' is not assignable to type 'number'. |
| 47 | + |
| 48 | + |
| 49 | +==== tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts (18 errors) ==== |
| 50 | + interface StrNum extends Array<string|number> { |
| 51 | + 0: string; |
| 52 | + 1: number; |
| 53 | + } |
| 54 | + |
| 55 | + var x: [string, number]; |
| 56 | + var y: StrNum |
| 57 | + var z: { |
| 58 | + 0: string; |
| 59 | + 1: number; |
| 60 | + } |
| 61 | + |
| 62 | + var [a, b, c] = x; |
| 63 | + ~ |
| 64 | +!!! error TS2493: Tuple type '[string, number]' with length '2' cannot be assigned to tuple with length '3'. |
| 65 | + var [d, e, f] = y; |
| 66 | + ~ |
| 67 | +!!! error TS2460: Type 'StrNum' has no property '2'. |
| 68 | + var [g, h, i] = z; |
| 69 | + ~~~~~~~~~ |
| 70 | +!!! error TS2461: Type '{ 0: string; 1: number; }' is not an array type. |
| 71 | + var j1: [number, number, number] = x; |
| 72 | + ~~ |
| 73 | +!!! error TS2322: Type '[string, number]' is not assignable to type '[number, number, number]'. |
| 74 | +!!! error TS2322: Types of property '0' are incompatible. |
| 75 | +!!! error TS2322: Type 'string' is not assignable to type 'number'. |
| 76 | + var j2: [number, number, number] = y; |
| 77 | + ~~ |
| 78 | +!!! error TS2322: Type 'StrNum' is not assignable to type '[number, number, number]'. |
| 79 | +!!! error TS2322: Types of property '0' are incompatible. |
| 80 | +!!! error TS2322: Type 'string' is not assignable to type 'number'. |
| 81 | + var j3: [number, number, number] = z; |
| 82 | + ~~ |
| 83 | +!!! error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[number, number, number]'. |
| 84 | +!!! error TS2322: Types of property '0' are incompatible. |
| 85 | +!!! error TS2322: Type 'string' is not assignable to type 'number'. |
| 86 | + var k1: [string, number, number] = x; |
| 87 | + ~~ |
| 88 | +!!! error TS2322: Type '[string, number]' is not assignable to type '[string, number, number]'. |
| 89 | +!!! error TS2322: Property '2' is missing in type '[string, number]'. |
| 90 | + var k2: [string, number, number] = y; |
| 91 | + ~~ |
| 92 | +!!! error TS2322: Type 'StrNum' is not assignable to type '[string, number, number]'. |
| 93 | +!!! error TS2322: Property '2' is missing in type 'StrNum'. |
| 94 | + var k3: [string, number, number] = z; |
| 95 | + ~~ |
| 96 | +!!! error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[string, number, number]'. |
| 97 | +!!! error TS2322: Property '2' is missing in type '{ 0: string; 1: number; }'. |
| 98 | + var l1: [number] = x; |
| 99 | + ~~ |
| 100 | +!!! error TS2322: Type '[string, number]' is not assignable to type '[number]'. |
| 101 | +!!! error TS2322: Types of property '0' are incompatible. |
| 102 | +!!! error TS2322: Type 'string' is not assignable to type 'number'. |
| 103 | + var l2: [number] = y; |
| 104 | + ~~ |
| 105 | +!!! error TS2322: Type 'StrNum' is not assignable to type '[number]'. |
| 106 | +!!! error TS2322: Types of property '0' are incompatible. |
| 107 | +!!! error TS2322: Type 'string' is not assignable to type 'number'. |
| 108 | + var l3: [number] = z; |
| 109 | + ~~ |
| 110 | +!!! error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[number]'. |
| 111 | +!!! error TS2322: Types of property '0' are incompatible. |
| 112 | +!!! error TS2322: Type 'string' is not assignable to type 'number'. |
| 113 | + var m1: [string] = x; |
| 114 | + ~~ |
| 115 | +!!! error TS2322: Type '[string, number]' is not assignable to type '[string]'. |
| 116 | +!!! error TS2322: Types of property 'pop' are incompatible. |
| 117 | +!!! error TS2322: Type '() => string | number' is not assignable to type '() => string'. |
| 118 | +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. |
| 119 | +!!! error TS2322: Type 'number' is not assignable to type 'string'. |
| 120 | + var m2: [string] = y; |
| 121 | + ~~ |
| 122 | +!!! error TS2322: Type 'StrNum' is not assignable to type '[string]'. |
| 123 | +!!! error TS2322: Types of property 'pop' are incompatible. |
| 124 | +!!! error TS2322: Type '() => string | number' is not assignable to type '() => string'. |
| 125 | + var m3: [string] = z; |
| 126 | + ~~ |
| 127 | +!!! error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[string]'. |
| 128 | +!!! error TS2322: Property 'length' is missing in type '{ 0: string; 1: number; }'. |
| 129 | + var n1: [number, string] = x; |
| 130 | + ~~ |
| 131 | +!!! error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. |
| 132 | +!!! error TS2322: Types of property '0' are incompatible. |
| 133 | +!!! error TS2322: Type 'string' is not assignable to type 'number'. |
| 134 | + var n2: [number, string] = y; |
| 135 | + ~~ |
| 136 | +!!! error TS2322: Type 'StrNum' is not assignable to type '[number, string]'. |
| 137 | +!!! error TS2322: Types of property '0' are incompatible. |
| 138 | +!!! error TS2322: Type 'string' is not assignable to type 'number'. |
| 139 | + var n3: [number, string] = z; |
| 140 | + ~~ |
| 141 | +!!! error TS2322: Type '{ 0: string; 1: number; }' is not assignable to type '[number, string]'. |
| 142 | +!!! error TS2322: Types of property '0' are incompatible. |
| 143 | +!!! error TS2322: Type 'string' is not assignable to type 'number'. |
| 144 | + var o1: [string, number] = x; |
| 145 | + var o2: [string, number] = y; |
| 146 | + var o3: [string, number] = y; |
| 147 | + |
0 commit comments