var f1: (a: number | string) => undefined = function(){};
var f2: (a: number) => undefined = f1;
// Error: Type "(number | string) => undefined" is incompatible with type "(number) => undefined"
// but it should work.
var f3: () => string = function(){ return '1'};
var f4: () => number | string = f3;
// Error: Type "() => string" is incompatible with type "() => number | string"
// but it should work.
Playground