Skip to content

Commit 36e17f6

Browse files
committed
Add tests
1 parent c62855a commit 36e17f6

5 files changed

+267
-233
lines changed

tests/baselines/reference/genericFunctionInference1.errors.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/genericFunctionInference1.ts(135,14): error TS2345: Argument of type '<a>(value: { key: a; }) => a' is not assignable to parameter of type '(value: Data) => string'.
1+
tests/cases/compiler/genericFunctionInference1.ts(139,14): error TS2345: Argument of type '<a>(value: { key: a; }) => a' is not assignable to parameter of type '(value: Data) => string'.
22
Type 'number' is not assignable to type 'string'.
33

44

@@ -114,6 +114,10 @@ tests/cases/compiler/genericFunctionInference1.ts(135,14): error TS2345: Argumen
114114

115115
const GenericComp2 = myHoc(GenericComp);
116116

117+
// GH#33139
118+
119+
const l: number[] = list.call(undefined, 1);
120+
117121
// #417
118122

119123
function mirror<A, B>(f: (a: A) => B): (a: A) => B { return f; }

tests/baselines/reference/genericFunctionInference1.js

+6
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ declare class GenericComp<T> extends Comp<GenericProps<T>> {}
110110

111111
const GenericComp2 = myHoc(GenericComp);
112112

113+
// GH#33139
114+
115+
const l: number[] = list.call(undefined, 1);
116+
113117
// #417
114118

115119
function mirror<A, B>(f: (a: A) => B): (a: A) => B { return f; }
@@ -301,6 +305,8 @@ const p2 = newPoint(10, 20);
301305
const bag1 = new Bag(1, 2, 3);
302306
const bag2 = newBag('a', 'b', 'c');
303307
const GenericComp2 = myHoc(GenericComp);
308+
// GH#33139
309+
const l = list.call(undefined, 1);
304310
// #417
305311
function mirror(f) { return f; }
306312
var identityM = mirror(identity);

0 commit comments

Comments
 (0)