Skip to content

Commit 8a41f5f

Browse files
committed
Accept new baselines
1 parent e9679f0 commit 8a41f5f

File tree

4 files changed

+1009
-0
lines changed

4 files changed

+1009
-0
lines changed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
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+
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
//// [strictBindCallApply1.ts]
2+
declare function foo(a: number, b: string): string;
3+
4+
let f00 = foo.bind(undefined);
5+
let f01 = foo.bind(undefined, 10);
6+
let f02 = foo.bind(undefined, 10, "hello");
7+
let f03 = foo.bind(undefined, 10, 20); // Error
8+
9+
let c00 = foo.call(undefined, 10, "hello");
10+
let c01 = foo.call(undefined, 10); // Error
11+
let c02 = foo.call(undefined, 10, 20); // Error
12+
let c03 = foo.call(undefined, 10, "hello", 30); // Error
13+
14+
let a00 = foo.apply(undefined, [10, "hello"]);
15+
let a01 = foo.apply(undefined, [10]); // Error
16+
let a02 = foo.apply(undefined, [10, 20]); // Error
17+
let a03 = foo.apply(undefined, [10, "hello", 30]); // Error
18+
19+
class C {
20+
constructor(a: number, b: string) {}
21+
foo(this: this, a: number, b: string): string { return "" }
22+
}
23+
24+
declare let c: C;
25+
declare let obj: {};
26+
27+
let f10 = c.foo.bind(c);
28+
let f11 = c.foo.bind(c, 10);
29+
let f12 = c.foo.bind(c, 10, "hello");
30+
let f13 = c.foo.bind(c, 10, 20); // Error
31+
let f14 = c.foo.bind(undefined); // Error
32+
33+
let c10 = c.foo.call(c, 10, "hello");
34+
let c11 = c.foo.call(c, 10); // Error
35+
let c12 = c.foo.call(c, 10, 20); // Error
36+
let c13 = c.foo.call(c, 10, "hello", 30); // Error
37+
let c14 = c.foo.call(undefined, 10, "hello"); // Error
38+
39+
let a10 = c.foo.apply(c, [10, "hello"]);
40+
let a11 = c.foo.apply(c, [10]); // Error
41+
let a12 = c.foo.apply(c, [10, 20]); // Error
42+
let a13 = c.foo.apply(c, [10, "hello", 30]); // Error
43+
let a14 = c.foo.apply(undefined, [10, "hello"]); // Error
44+
45+
let f20 = C.bind(undefined);
46+
let f21 = C.bind(undefined, 10);
47+
let f22 = C.bind(undefined, 10, "hello");
48+
let f23 = C.bind(undefined, 10, 20); // Error
49+
50+
C.call(c, 10, "hello");
51+
C.call(c, 10); // Error
52+
C.call(c, 10, 20); // Error
53+
C.call(c, 10, "hello", 30); // Error
54+
55+
C.apply(c, [10, "hello"]);
56+
C.apply(c, [10]); // Error
57+
C.apply(c, [10, 20]); // Error
58+
C.apply(c, [10, "hello", 30]); // Error
59+
60+
61+
//// [strictBindCallApply1.js]
62+
"use strict";
63+
var f00 = foo.bind(undefined);
64+
var f01 = foo.bind(undefined, 10);
65+
var f02 = foo.bind(undefined, 10, "hello");
66+
var f03 = foo.bind(undefined, 10, 20); // Error
67+
var c00 = foo.call(undefined, 10, "hello");
68+
var c01 = foo.call(undefined, 10); // Error
69+
var c02 = foo.call(undefined, 10, 20); // Error
70+
var c03 = foo.call(undefined, 10, "hello", 30); // Error
71+
var a00 = foo.apply(undefined, [10, "hello"]);
72+
var a01 = foo.apply(undefined, [10]); // Error
73+
var a02 = foo.apply(undefined, [10, 20]); // Error
74+
var a03 = foo.apply(undefined, [10, "hello", 30]); // Error
75+
var C = /** @class */ (function () {
76+
function C(a, b) {
77+
}
78+
C.prototype.foo = function (a, b) { return ""; };
79+
return C;
80+
}());
81+
var f10 = c.foo.bind(c);
82+
var f11 = c.foo.bind(c, 10);
83+
var f12 = c.foo.bind(c, 10, "hello");
84+
var f13 = c.foo.bind(c, 10, 20); // Error
85+
var f14 = c.foo.bind(undefined); // Error
86+
var c10 = c.foo.call(c, 10, "hello");
87+
var c11 = c.foo.call(c, 10); // Error
88+
var c12 = c.foo.call(c, 10, 20); // Error
89+
var c13 = c.foo.call(c, 10, "hello", 30); // Error
90+
var c14 = c.foo.call(undefined, 10, "hello"); // Error
91+
var a10 = c.foo.apply(c, [10, "hello"]);
92+
var a11 = c.foo.apply(c, [10]); // Error
93+
var a12 = c.foo.apply(c, [10, 20]); // Error
94+
var a13 = c.foo.apply(c, [10, "hello", 30]); // Error
95+
var a14 = c.foo.apply(undefined, [10, "hello"]); // Error
96+
var f20 = C.bind(undefined);
97+
var f21 = C.bind(undefined, 10);
98+
var f22 = C.bind(undefined, 10, "hello");
99+
var f23 = C.bind(undefined, 10, 20); // Error
100+
C.call(c, 10, "hello");
101+
C.call(c, 10); // Error
102+
C.call(c, 10, 20); // Error
103+
C.call(c, 10, "hello", 30); // Error
104+
C.apply(c, [10, "hello"]);
105+
C.apply(c, [10]); // Error
106+
C.apply(c, [10, 20]); // Error
107+
C.apply(c, [10, "hello", 30]); // Error

0 commit comments

Comments
 (0)