Is there an ABI-compatible way to remove/reduce constraints?

Currently, RandomNumberGenerator.next(upperBound) is available for T: FixedWidthInteger & UnsignedInteger.

If an implementation were written that works with all UnsignedInteger types, could the FixedWidthInteger constraint be lifted in an ABI-compatible way?

We would simply add a new overload with the desired constraint. The old one would need to stick around for binary-compatibility reasons, but I believe that we'd be able to mark it unavailable.

1 Like