Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contravariant type parameter 'a is not allowed #155

Open
Lupus opened this issue Sep 24, 2021 · 0 comments
Open

Contravariant type parameter 'a is not allowed #155

Lupus opened this issue Sep 24, 2021 · 0 comments

Comments

@Lupus
Copy link

Lupus commented Sep 24, 2021

I'm trying to bind the following TypeScript definition:

export type ValueCallback<T> = (err: Error, val: T) => void;

Naive approach results in this error:

File "out.mli", line 8, characters 36-38:
8 | type 'a value_callback = Error.t -> 'a -> unit
                                        ^^
Error: Contravariant type parameter 'a is not allowed.

I'm wondering why can't existing support for type parameters be extended for this case? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant