Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Allow function covariance/contravariance #342

Open
whzx5byb opened this issue Jun 26, 2021 · 0 comments
Open

Allow function covariance/contravariance #342

whzx5byb opened this issue Jun 26, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@whzx5byb
Copy link

Playground

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.
@JSMonk JSMonk self-assigned this Jul 4, 2021
@JSMonk JSMonk added the bug Something isn't working label Jul 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants