You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
c9d8008 marked JS promises covariant. We should do the same in the native version. However, that is a full implementation, and a correct implementation of promises usually prevents the compiler from admitting covariance (the compiler infers invariance). This is because such an implementation requires several helper data structures to defer callbacks and avoid memory leaks, so we need to either:
Add casts to fool the compiler (as in Lwt).
Search more thoroughly for data structures that don't prevent the compiler from inferring covariance.
The current data structures don't (or shouldn't!!) make the promises invariant, the compiler just can't tell that they don't.
After dealing with this, the covariance tests should be made to run (rather, build) on both JS and native:
c9d8008 marked JS promises covariant. We should do the same in the native version. However, that is a full implementation, and a correct implementation of promises usually prevents the compiler from admitting covariance (the compiler infers invariance). This is because such an implementation requires several helper data structures to defer callbacks and avoid memory leaks, so we need to either:
The current data structures don't (or shouldn't!!) make the promises invariant, the compiler just can't tell that they don't.
After dealing with this, the covariance tests should be made to run (rather, build) on both JS and native:
promise/test/js/test_ffi.re
Lines 316 to 360 in c9d8008
The text was updated successfully, but these errors were encountered: