Open straight-shoota opened 1 month ago
Hm, actually this can overflow on ranges of Int
types that are bigger than Int32
🤔
Should we only cast to Int32
on smaller types?
I'm afraid there's no good solution here. The good part of raising on overflow is that if it fits, it works. The bad part is that the failure is at runtime...
An alternative, as good or bad, is to statically fail on > Int32 types and have people do the math themselves 🤷
Resolves #14587
The
super
implementationEnumerable#size
has the same type restriction already.