2017-02-22 00:59:19 +03:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
|
|
exports[`poly.js 1`] = `
|
2016-12-23 22:31:38 +03:00
|
|
|
"var foo1 = function<T>(x:T):T { return x; }
|
|
|
|
|
|
|
|
function foo2<T,S>(x:T):S { return x; }
|
|
|
|
|
|
|
|
var foo3 = function <T>(x:T):T { return foo3(x); }
|
|
|
|
|
|
|
|
function foo4<T,S>(x:T):S { return foo4(x); }
|
|
|
|
|
|
|
|
var x = [];
|
|
|
|
function foo5<T>():Array<T> { return x; }
|
|
|
|
/*
|
|
|
|
var a = foo5();
|
|
|
|
a[0] = 0;
|
|
|
|
var b = foo5();
|
|
|
|
var y: string = b[0];
|
|
|
|
*/
|
|
|
|
|
|
|
|
var foo6 = function<R>(x:R):R { return foo1(x); }
|
|
|
|
|
|
|
|
function foo7<R>(x:R):R { return foo5(); }
|
|
|
|
|
|
|
|
function foo8<U>(x:U,y):U {
|
|
|
|
var z = foo8(x,x);
|
|
|
|
y();
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
foo8(0,void 0);
|
|
|
|
*/
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2016-12-30 21:41:45 +03:00
|
|
|
var foo1 = function<T>(x: T): T {
|
2016-12-27 21:29:31 +03:00
|
|
|
return x;
|
|
|
|
};
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
function foo2<T, S>(x: T): S {
|
|
|
|
return x;
|
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-30 21:41:45 +03:00
|
|
|
var foo3 = function<T>(x: T): T {
|
2016-12-27 21:29:31 +03:00
|
|
|
return foo3(x);
|
|
|
|
};
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
function foo4<T, S>(x: T): S {
|
|
|
|
return foo4(x);
|
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-31 07:01:07 +03:00
|
|
|
var x = [];
|
2016-12-27 21:29:31 +03:00
|
|
|
function foo5<T>(): Array<T> {
|
|
|
|
return x;
|
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
/*
|
|
|
|
var a = foo5();
|
|
|
|
a[0] = 0;
|
|
|
|
var b = foo5();
|
|
|
|
var y: string = b[0];
|
|
|
|
*/
|
2017-01-27 22:05:41 +03:00
|
|
|
|
2016-12-30 21:41:45 +03:00
|
|
|
var foo6 = function<R>(x: R): R {
|
2016-12-27 21:29:31 +03:00
|
|
|
return foo1(x);
|
|
|
|
};
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
function foo7<R>(x: R): R {
|
|
|
|
return foo5();
|
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-27 21:29:31 +03:00
|
|
|
function foo8<U>(x: U, y): U {
|
|
|
|
var z = foo8(x, x);
|
|
|
|
y();
|
|
|
|
return x;
|
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
/*
|
|
|
|
foo8(0,void 0);
|
2017-01-11 18:16:38 +03:00
|
|
|
*/
|
|
|
|
"
|
2016-12-23 22:31:38 +03:00
|
|
|
`;
|