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
Mohamed Hegazy (@mhegazy), out of curiosity, which problems did you find for flow of arithmetic on types? As @tycho01 pointed out, there is no reference to this in the issue you mentioned.
#26382 has been determined to be a duplicate of this, although that one is about allowing arithmetic at the type level at all, while this one seems to be more concerned with inference and flow.
Anyway, I think that now that tuple types are becoming more powerful it might be reasonable to revisit this idea so that we can get closer to the sort of dependent types needed for strongly typing such methods as Function['bind']. (Related to #26223)
Reacted by Abraham White, Homa Wong, Felipe S. S. Schneider and Eric Bieszczad-Stie
Activity
mhegazy commentedon May 8, 2017
It was one of the design decisions not do do any type arithmetic. see #8112.
KiaraGrouwstra commentedon May 18, 2017
Hm. Is that what #8112 meant by this?
I hadn't managed to find mention of this in #7480 either. Were there any specific issues there we could think along on?
mstn commentedon Apr 23, 2018
Mohamed Hegazy (@mhegazy), out of curiosity, which problems did you find for flow of arithmetic on types? As @tycho01 pointed out, there is no reference to this in the issue you mentioned.
jcalz commentedon Aug 12, 2018
#26382 has been determined to be a duplicate of this, although that one is about allowing arithmetic at the type level at all, while this one seems to be more concerned with inference and flow.
Anyway, I think that now that tuple types are becoming more powerful it might be reasonable to revisit this idea so that we can get closer to the sort of dependent types needed for strongly typing such methods as
Function['bind']. (Related to #26223)unional commentedon Oct 9, 2020
There are
Inc<>andDec<>(typical) andMinus<>(ts-toolbelt).It is critical in doing type manipulation.
The custom implementation has limitation and not efficient at all.
With
intrinsicin TypeScript 4.1, it would be great if TypeScript can provide those base types.