gen_js_api
gen_js_api copied to clipboard
Contravariant type parameter 'a is not allowed
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? 🤔