Skip to content

Commit ba4a8fc

Browse files
committed
Add tests
1 parent 8b4090b commit ba4a8fc

5 files changed

+256
-233
lines changed

tests/baselines/reference/genericFunctionInference1.errors.txt

+3-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(137,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,8 @@ tests/cases/compiler/genericFunctionInference1.ts(135,14): error TS2345: Argumen
114114

115115
const GenericComp2 = myHoc(GenericComp);
116116

117+
const l: string[] = list.call(undefined, "");
118+
117119
// #417
118120

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

tests/baselines/reference/genericFunctionInference1.js

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

111111
const GenericComp2 = myHoc(GenericComp);
112112

113+
const l: string[] = list.call(undefined, "");
114+
113115
// #417
114116

115117
function mirror<A, B>(f: (a: A) => B): (a: A) => B { return f; }
@@ -301,6 +303,7 @@ const p2 = newPoint(10, 20);
301303
const bag1 = new Bag(1, 2, 3);
302304
const bag2 = newBag('a', 'b', 'c');
303305
const GenericComp2 = myHoc(GenericComp);
306+
const l = list.call(undefined, "");
304307
// #417
305308
function mirror(f) { return f; }
306309
var identityM = mirror(identity);

0 commit comments

Comments
 (0)