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
This issue assumes the approach in #438 was taken, and proposes a possible follow-up.
Currently, it's allowed to combine Futures with differing rejection types, for example in the following overload for alt, the rejection type is known, but not enforced in the second argument:
<FextendsAnyFuture,SextendsAnyFuture>(second: FextendsRejected<unknown> ? S : never): (first: F)=>S
Both could be made to tell the user they are doing something naughty when the user attempts to provide a second Future with a differing rejection type:
<L>(second: Rejected<L>): {(first: Never): Never(first: Rejected<L>): Rejected<L>// L instead of any<R>(first: Resolved<R>): Resolved<R><R>(first: Uncertain<L,R>): Uncertain<L,R>// L instead of any}
// infer L from F and constrain S<FextendsAnyFuture,SextendsAnyFuture>(second: FextendsRejected<infer L> ? SextendsUncertain<L,unknown> ? S : never : never): (first: F)=>S
This same principle applies to other algebras that wouldn't normally allow for changes in the rejection branch.
The text was updated successfully, but these errors were encountered:
This issue assumes the approach in #438 was taken, and proposes a possible follow-up.
Currently, it's allowed to combine Futures with differing rejection types, for example in the following overload for
alt
, the rejection type is known, but not enforced in the second argument:Fluture/index.d.ts
Lines 94 to 99 in 06bc7c9
The same goes for the piped version of this type:
Fluture/index.d.ts
Line 91 in 06bc7c9
Both could be made to tell the user they are doing something naughty when the user attempts to provide a second Future with a differing rejection type:
This same principle applies to other algebras that wouldn't normally allow for changes in the rejection branch.
The text was updated successfully, but these errors were encountered: