Skip to content

Commit 4d67c8f

Browse files
committed
Accept new baselines
1 parent d2cc282 commit 4d67c8f

File tree

4 files changed

+313
-142
lines changed

4 files changed

+313
-142
lines changed

tests/baselines/reference/strictBindCallApply1.errors.txt

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,50 @@
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]'.
1+
tests/cases/conformance/functions/strictBindCallApply1.ts(11,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
2+
tests/cases/conformance/functions/strictBindCallApply1.ts(17,11): error TS2554: Expected 3 arguments, but got 2.
3+
tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
4+
tests/cases/conformance/functions/strictBindCallApply1.ts(19,11): error TS2554: Expected 3 arguments, but got 4.
5+
tests/cases/conformance/functions/strictBindCallApply1.ts(22,32): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
66
Property '1' is missing in type '[number]' but required in type '[number, string]'.
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]'.
7+
tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: Type 'number' is not assignable to type 'string'.
8+
tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'.
99
Types of property 'length' are incompatible.
1010
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]'.
11+
tests/cases/conformance/functions/strictBindCallApply1.ts(41,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
12+
tests/cases/conformance/functions/strictBindCallApply1.ts(42,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
13+
tests/cases/conformance/functions/strictBindCallApply1.ts(48,11): error TS2554: Expected 3 arguments, but got 2.
14+
tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
15+
tests/cases/conformance/functions/strictBindCallApply1.ts(50,11): error TS2554: Expected 3 arguments, but got 4.
16+
tests/cases/conformance/functions/strictBindCallApply1.ts(51,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
17+
tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
18+
tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'.
19+
tests/cases/conformance/functions/strictBindCallApply1.ts(56,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(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
21+
tests/cases/conformance/functions/strictBindCallApply1.ts(62,33): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
22+
tests/cases/conformance/functions/strictBindCallApply1.ts(65,1): error TS2554: Expected 3 arguments, but got 2.
23+
tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
24+
tests/cases/conformance/functions/strictBindCallApply1.ts(67,1): error TS2554: Expected 3 arguments, but got 4.
25+
tests/cases/conformance/functions/strictBindCallApply1.ts(70,12): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'.
26+
tests/cases/conformance/functions/strictBindCallApply1.ts(71,17): error TS2322: Type 'number' is not assignable to type 'string'.
27+
tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'.
2828

2929

3030
==== tests/cases/conformance/functions/strictBindCallApply1.ts (24 errors) ====
3131
declare function foo(a: number, b: string): string;
3232

33+
declare function overloaded(s: string): number;
34+
declare function overloaded(n: number): string;
35+
36+
declare function generic<T>(x: T): T;
37+
3338
let f00 = foo.bind(undefined);
3439
let f01 = foo.bind(undefined, 10);
3540
let f02 = foo.bind(undefined, 10, "hello");
3641
let f03 = foo.bind(undefined, 10, 20); // Error
3742
~~
3843
!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'.
3944

45+
let f04 = overloaded.bind(undefined); // typeof overloaded
46+
let f05 = generic.bind(undefined); // typeof generic
47+
4048
let c00 = foo.call(undefined, 10, "hello");
4149
let c01 = foo.call(undefined, 10); // Error
4250
~~~~~~~~~~~~~~~~~~~~~~~
@@ -65,6 +73,10 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345:
6573
class C {
6674
constructor(a: number, b: string) {}
6775
foo(this: this, a: number, b: string): string { return "" }
76+
overloaded(s: string): number;
77+
overloaded(n: number): string;
78+
overloaded(x: any): any { return <any>undefined }
79+
generic<T>(x: T): T { return x }
6880
}
6981

7082
declare let c: C;
@@ -80,6 +92,9 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345:
8092
~~~~~~~~~
8193
!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'.
8294

95+
let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded
96+
let f16 = c.generic.bind(c); // typeof C.prototype.generic
97+
8398
let c10 = c.foo.call(c, 10, "hello");
8499
let c11 = c.foo.call(c, 10); // Error
85100
~~~~~~~~~~~~~~~~~

tests/baselines/reference/strictBindCallApply1.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
//// [strictBindCallApply1.ts]
22
declare function foo(a: number, b: string): string;
33

4+
declare function overloaded(s: string): number;
5+
declare function overloaded(n: number): string;
6+
7+
declare function generic<T>(x: T): T;
8+
49
let f00 = foo.bind(undefined);
510
let f01 = foo.bind(undefined, 10);
611
let f02 = foo.bind(undefined, 10, "hello");
712
let f03 = foo.bind(undefined, 10, 20); // Error
813

14+
let f04 = overloaded.bind(undefined); // typeof overloaded
15+
let f05 = generic.bind(undefined); // typeof generic
16+
917
let c00 = foo.call(undefined, 10, "hello");
1018
let c01 = foo.call(undefined, 10); // Error
1119
let c02 = foo.call(undefined, 10, 20); // Error
@@ -19,6 +27,10 @@ let a03 = foo.apply(undefined, [10, "hello", 30]); // Error
1927
class C {
2028
constructor(a: number, b: string) {}
2129
foo(this: this, a: number, b: string): string { return "" }
30+
overloaded(s: string): number;
31+
overloaded(n: number): string;
32+
overloaded(x: any): any { return <any>undefined }
33+
generic<T>(x: T): T { return x }
2234
}
2335

2436
declare let c: C;
@@ -30,6 +42,9 @@ let f12 = c.foo.bind(c, 10, "hello");
3042
let f13 = c.foo.bind(c, 10, 20); // Error
3143
let f14 = c.foo.bind(undefined); // Error
3244

45+
let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded
46+
let f16 = c.generic.bind(c); // typeof C.prototype.generic
47+
3348
let c10 = c.foo.call(c, 10, "hello");
3449
let c11 = c.foo.call(c, 10); // Error
3550
let c12 = c.foo.call(c, 10, 20); // Error
@@ -64,6 +79,8 @@ var f00 = foo.bind(undefined);
6479
var f01 = foo.bind(undefined, 10);
6580
var f02 = foo.bind(undefined, 10, "hello");
6681
var f03 = foo.bind(undefined, 10, 20); // Error
82+
var f04 = overloaded.bind(undefined); // typeof overloaded
83+
var f05 = generic.bind(undefined); // typeof generic
6784
var c00 = foo.call(undefined, 10, "hello");
6885
var c01 = foo.call(undefined, 10); // Error
6986
var c02 = foo.call(undefined, 10, 20); // Error
@@ -76,13 +93,17 @@ var C = /** @class */ (function () {
7693
function C(a, b) {
7794
}
7895
C.prototype.foo = function (a, b) { return ""; };
96+
C.prototype.overloaded = function (x) { return undefined; };
97+
C.prototype.generic = function (x) { return x; };
7998
return C;
8099
}());
81100
var f10 = c.foo.bind(c);
82101
var f11 = c.foo.bind(c, 10);
83102
var f12 = c.foo.bind(c, 10, "hello");
84103
var f13 = c.foo.bind(c, 10, 20); // Error
85104
var f14 = c.foo.bind(undefined); // Error
105+
var f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded
106+
var f16 = c.generic.bind(c); // typeof C.prototype.generic
86107
var c10 = c.foo.call(c, 10, "hello");
87108
var c11 = c.foo.call(c, 10); // Error
88109
var c12 = c.foo.call(c, 10, 20); // Error

0 commit comments

Comments
 (0)