Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko committed Feb 13, 2020
1 parent edf3ce2 commit 84cb8d9
Show file tree
Hide file tree
Showing 5 changed files with 256 additions and 233 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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'.
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'.
Type 'number' is not assignable to type 'string'.


Expand Down Expand Up @@ -114,6 +114,8 @@ tests/cases/compiler/genericFunctionInference1.ts(135,14): error TS2345: Argumen

const GenericComp2 = myHoc(GenericComp);

const l: string[] = list.call(undefined, "");

// #417

function mirror<A, B>(f: (a: A) => B): (a: A) => B { return f; }
Expand Down
3 changes: 3 additions & 0 deletions tests/baselines/reference/genericFunctionInference1.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ declare class GenericComp<T> extends Comp<GenericProps<T>> {}

const GenericComp2 = myHoc(GenericComp);

const l: string[] = list.call(undefined, "");

// #417

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

0 comments on commit 84cb8d9

Please sign in to comment.