|
| 1 | +tests/cases/conformance/functions/strictBindCallApply1.ts(6,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 2 | +tests/cases/conformance/functions/strictBindCallApply1.ts(9,11): error TS2554: Expected 3 arguments, but got 2. |
| 3 | +tests/cases/conformance/functions/strictBindCallApply1.ts(10,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 4 | +tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2554: Expected 3 arguments, but got 4. |
| 5 | +tests/cases/conformance/functions/strictBindCallApply1.ts(14,32): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. |
| 6 | + Property '1' is missing in type '[number]'. |
| 7 | +tests/cases/conformance/functions/strictBindCallApply1.ts(15,37): error TS2322: Type 'number' is not assignable to type 'string'. |
| 8 | +tests/cases/conformance/functions/strictBindCallApply1.ts(16,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. |
| 9 | + Types of property 'length' are incompatible. |
| 10 | + Type '3' is not assignable to type '2'. |
| 11 | +tests/cases/conformance/functions/strictBindCallApply1.ts(29,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 12 | +tests/cases/conformance/functions/strictBindCallApply1.ts(30,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. |
| 13 | +tests/cases/conformance/functions/strictBindCallApply1.ts(33,11): error TS2554: Expected 3 arguments, but got 2. |
| 14 | +tests/cases/conformance/functions/strictBindCallApply1.ts(34,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 15 | +tests/cases/conformance/functions/strictBindCallApply1.ts(35,11): error TS2554: Expected 3 arguments, but got 4. |
| 16 | +tests/cases/conformance/functions/strictBindCallApply1.ts(36,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. |
| 17 | +tests/cases/conformance/functions/strictBindCallApply1.ts(39,26): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. |
| 18 | +tests/cases/conformance/functions/strictBindCallApply1.ts(40,31): error TS2322: Type 'number' is not assignable to type 'string'. |
| 19 | +tests/cases/conformance/functions/strictBindCallApply1.ts(41,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. |
| 20 | +tests/cases/conformance/functions/strictBindCallApply1.ts(42,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. |
| 21 | +tests/cases/conformance/functions/strictBindCallApply1.ts(47,33): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 22 | +tests/cases/conformance/functions/strictBindCallApply1.ts(50,1): error TS2554: Expected 3 arguments, but got 2. |
| 23 | +tests/cases/conformance/functions/strictBindCallApply1.ts(51,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 24 | +tests/cases/conformance/functions/strictBindCallApply1.ts(52,1): error TS2554: Expected 3 arguments, but got 4. |
| 25 | +tests/cases/conformance/functions/strictBindCallApply1.ts(55,12): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. |
| 26 | +tests/cases/conformance/functions/strictBindCallApply1.ts(56,17): error TS2322: Type 'number' is not assignable to type 'string'. |
| 27 | +tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. |
| 28 | + |
| 29 | + |
| 30 | +==== tests/cases/conformance/functions/strictBindCallApply1.ts (24 errors) ==== |
| 31 | + declare function foo(a: number, b: string): string; |
| 32 | + |
| 33 | + let f00 = foo.bind(undefined); |
| 34 | + let f01 = foo.bind(undefined, 10); |
| 35 | + let f02 = foo.bind(undefined, 10, "hello"); |
| 36 | + let f03 = foo.bind(undefined, 10, 20); // Error |
| 37 | + ~~ |
| 38 | +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 39 | + |
| 40 | + let c00 = foo.call(undefined, 10, "hello"); |
| 41 | + let c01 = foo.call(undefined, 10); // Error |
| 42 | + ~~~~~~~~~~~~~~~~~~~~~~~ |
| 43 | +!!! error TS2554: Expected 3 arguments, but got 2. |
| 44 | + let c02 = foo.call(undefined, 10, 20); // Error |
| 45 | + ~~ |
| 46 | +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 47 | + let c03 = foo.call(undefined, 10, "hello", 30); // Error |
| 48 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 49 | +!!! error TS2554: Expected 3 arguments, but got 4. |
| 50 | + |
| 51 | + let a00 = foo.apply(undefined, [10, "hello"]); |
| 52 | + let a01 = foo.apply(undefined, [10]); // Error |
| 53 | + ~~~~ |
| 54 | +!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. |
| 55 | +!!! error TS2345: Property '1' is missing in type '[number]'. |
| 56 | + let a02 = foo.apply(undefined, [10, 20]); // Error |
| 57 | + ~~ |
| 58 | +!!! error TS2322: Type 'number' is not assignable to type 'string'. |
| 59 | + let a03 = foo.apply(undefined, [10, "hello", 30]); // Error |
| 60 | + ~~~~~~~~~~~~~~~~~ |
| 61 | +!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. |
| 62 | +!!! error TS2345: Types of property 'length' are incompatible. |
| 63 | +!!! error TS2345: Type '3' is not assignable to type '2'. |
| 64 | + |
| 65 | + class C { |
| 66 | + constructor(a: number, b: string) {} |
| 67 | + foo(this: this, a: number, b: string): string { return "" } |
| 68 | + } |
| 69 | + |
| 70 | + declare let c: C; |
| 71 | + declare let obj: {}; |
| 72 | + |
| 73 | + let f10 = c.foo.bind(c); |
| 74 | + let f11 = c.foo.bind(c, 10); |
| 75 | + let f12 = c.foo.bind(c, 10, "hello"); |
| 76 | + let f13 = c.foo.bind(c, 10, 20); // Error |
| 77 | + ~~ |
| 78 | +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 79 | + let f14 = c.foo.bind(undefined); // Error |
| 80 | + ~~~~~~~~~ |
| 81 | +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. |
| 82 | + |
| 83 | + let c10 = c.foo.call(c, 10, "hello"); |
| 84 | + let c11 = c.foo.call(c, 10); // Error |
| 85 | + ~~~~~~~~~~~~~~~~~ |
| 86 | +!!! error TS2554: Expected 3 arguments, but got 2. |
| 87 | + let c12 = c.foo.call(c, 10, 20); // Error |
| 88 | + ~~ |
| 89 | +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 90 | + let c13 = c.foo.call(c, 10, "hello", 30); // Error |
| 91 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 92 | +!!! error TS2554: Expected 3 arguments, but got 4. |
| 93 | + let c14 = c.foo.call(undefined, 10, "hello"); // Error |
| 94 | + ~~~~~~~~~ |
| 95 | +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. |
| 96 | + |
| 97 | + let a10 = c.foo.apply(c, [10, "hello"]); |
| 98 | + let a11 = c.foo.apply(c, [10]); // Error |
| 99 | + ~~~~ |
| 100 | +!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. |
| 101 | + let a12 = c.foo.apply(c, [10, 20]); // Error |
| 102 | + ~~ |
| 103 | +!!! error TS2322: Type 'number' is not assignable to type 'string'. |
| 104 | + let a13 = c.foo.apply(c, [10, "hello", 30]); // Error |
| 105 | + ~~~~~~~~~~~~~~~~~ |
| 106 | +!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. |
| 107 | + let a14 = c.foo.apply(undefined, [10, "hello"]); // Error |
| 108 | + ~~~~~~~~~ |
| 109 | +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. |
| 110 | + |
| 111 | + let f20 = C.bind(undefined); |
| 112 | + let f21 = C.bind(undefined, 10); |
| 113 | + let f22 = C.bind(undefined, 10, "hello"); |
| 114 | + let f23 = C.bind(undefined, 10, 20); // Error |
| 115 | + ~~ |
| 116 | +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 117 | + |
| 118 | + C.call(c, 10, "hello"); |
| 119 | + C.call(c, 10); // Error |
| 120 | + ~~~~~~~~~~~~~ |
| 121 | +!!! error TS2554: Expected 3 arguments, but got 2. |
| 122 | + C.call(c, 10, 20); // Error |
| 123 | + ~~ |
| 124 | +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. |
| 125 | + C.call(c, 10, "hello", 30); // Error |
| 126 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 127 | +!!! error TS2554: Expected 3 arguments, but got 4. |
| 128 | + |
| 129 | + C.apply(c, [10, "hello"]); |
| 130 | + C.apply(c, [10]); // Error |
| 131 | + ~~~~ |
| 132 | +!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. |
| 133 | + C.apply(c, [10, 20]); // Error |
| 134 | + ~~ |
| 135 | +!!! error TS2322: Type 'number' is not assignable to type 'string'. |
| 136 | + C.apply(c, [10, "hello", 30]); // Error |
| 137 | + ~~~~~~~~~~~~~~~~~ |
| 138 | +!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. |
| 139 | + |
0 commit comments