Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko committed Oct 7, 2019
1 parent 39a3eef commit 88d37ff
Show file tree
Hide file tree
Showing 5 changed files with 267 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(139,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,10 @@ tests/cases/compiler/genericFunctionInference1.ts(135,14): error TS2345: Argumen

const GenericComp2 = myHoc(GenericComp);

// #33139

const l: number[] = list.call(undefined, 1);

// #417

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

const GenericComp2 = myHoc(GenericComp);

// #33139

const l: number[] = list.call(undefined, 1);

// #417

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

0 comments on commit 88d37ff

Please sign in to comment.